feat: run tests on ARM targets #902
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Continuous Integration | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }}::${{ matrix.label }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
label: x86_64 | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
label: x86_64 gnu | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
label: x86_64 musl | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
label: arm64 gnu | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
label: arm64 musl | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
label: x86_64 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
run: rustup update --no-self-update | |
- name: Install target | |
run: rustup target add ${{ matrix.target }} | |
- name: Install musl-tools | |
if: ${{ runner.os == 'Linux' }} | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: musl-tools crossbuild-essential-arm64 crossbuild-essential-armhf # provides musl-gcc and arm64 linker | |
version: 1.0 | |
- name: Configure linker | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
cat >>~/.cargo/config <<EOF | |
[target.aarch64-unknown-linux-gnu] | |
linker = "aarch64-linux-gnu-gcc" | |
[target.aarch64-unknown-linux-musl] | |
linker = "aarch64-linux-gnu-gcc" | |
EOF | |
- name: Test | |
run: cargo test --target=${{ matrix.target }} | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
run: rustup update --no-self-update | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
run: rustup update --no-self-update | |
- name: Clippy Check | |
run: cargo clippy -- -D warnings |