xplr/.github/workflows/ci.yml

145 lines
3.7 KiB
YAML
Raw Normal View History

2021-11-10 02:43:15 +00:00
name: Continuous Integration
on:
pull_request:
push:
2021-06-23 09:56:59 +00:00
branches: main
workflow_dispatch:
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: cargo check
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- run: cargo clippy -- -D warnings
spellcheck:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: codespell-project/actions-codespell@v1
with:
ignore_words_file: .codespellignore
test:
name: Test Suite
2021-11-10 02:43:15 +00:00
runs-on: ${{ matrix.os }}
needs:
- check
- fmt
- clippy
- spellcheck
2021-11-10 02:43:15 +00:00
strategy:
matrix:
build:
- macos
- macos-aarch64
- linux
- linux-musl
2023-07-18 21:34:44 +00:00
- linux-aarch64
- linux-arm
2021-11-10 02:43:15 +00:00
rust: [stable]
include:
# See the list: https://github.com/cross-rs/cross
- build: macos
os: macos-latest
2021-11-10 02:43:15 +00:00
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-latest
target: aarch64-apple-darwin
- build: linux
os: ubuntu-latest
2021-11-10 02:43:15 +00:00
target: x86_64-unknown-linux-gnu
- build: linux-musl
os: ubuntu-latest
2021-11-10 02:43:15 +00:00
target: x86_64-unknown-linux-musl
2023-07-18 21:34:44 +00:00
- build: linux-aarch64
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
2023-07-18 21:34:44 +00:00
- build: linux-arm
os: ubuntu-latest
target: arm-unknown-linux-gnueabihf
env:
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v3
2021-11-10 02:43:15 +00:00
- name: Installing Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
2021-11-10 02:43:15 +00:00
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Installing needed macOS dependencies
if: matrix.os == 'macos-latest'
run: brew install openssl@1.1
- name: Installing needed Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
2021-11-10 02:43:15 +00:00
run: |
2023-01-13 06:33:04 +00:00
sudo apt-get update --fix-missing
2023-07-18 21:34:44 +00:00
sudo apt-get install -y --no-install-recommends liblua5.1-0-dev libluajit-5.1-dev gcc pkg-config curl git make ca-certificates
2021-11-10 02:43:15 +00:00
2023-07-18 21:34:44 +00:00
- if: matrix.build == 'linux-musl'
run: sudo apt-get install -y musl-tools
- if: matrix.build == 'linux-aarch64'
run: sudo apt-get install -y gcc-aarch64-linux-gnu
- if: matrix.build == 'linux-arm'
run: |
sudo apt-get install -y gcc-multilib
sudo apt-get install -y gcc-arm-linux-gnueabihf
sudo ln -s /usr/include/asm-generic/ /usr/include/asm
- run: cargo build --target ${{ matrix.target }}
2023-07-18 21:34:44 +00:00
- if: matrix.build == 'macos' || matrix.build == 'linux'
run: cargo test --target ${{ matrix.target }}
# bench:
# name: Benchmarks
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# with:
# toolchain: stable
# # These dependencies are required for `clipboard`
# - run: sudo apt-get install -y -qq libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
# - run: cargo bench