Skip to content

Commit

Permalink
ci: add aarch64 and armv7 Linux targets to test matrix
Browse files Browse the repository at this point in the history
- Add cross-compilation support for aarch64 and armv7 Linux
- Explicitly specify macOS targets (aarch64/x86_64-apple-darwin)
- Consolidate cross-compilation tools installation for Linux
- Improve test command to handle native targets correctly
  • Loading branch information
jamesbrink committed Feb 9, 2025
1 parent 5b1e9a3 commit 37818f2
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@ jobs:
include:
- os: ubuntu-latest
name: Linux (x86_64)
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
name: Linux (aarch64)
target: aarch64-unknown-linux-gnu
- os: ubuntu-latest
name: Linux (armv7)
target: armv7-unknown-linux-gnueabihf
- os: macos-14
name: macOS (Apple Silicon)
target: aarch64-apple-darwin
- os: macos-latest
name: macOS (Intel x86_64)
target: x86_64-apple-darwin
name: Test ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -33,15 +42,22 @@ jobs:
with:
toolchain: stable
components: clippy, rustfmt
targets: ${{ matrix.target }}

- name: Install cross-compilation tools
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Check formatting
run: cargo fmt --check
Expand All @@ -50,7 +66,12 @@ jobs:
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Run tests
run: cargo test --features testing
run: |
if [ -n "${{ matrix.target }}" ] && [ "${{ matrix.target }}" != "${{ runner.os == 'Linux' && 'x86_64-unknown-linux-gnu' || runner.os == 'macOS' && 'x86_64-apple-darwin' }}" ]; then
cargo test --features testing --target ${{ matrix.target }}
else
cargo test --features testing
fi
- name: Run security audit
uses: actions-rs/audit-check@v1
Expand Down

0 comments on commit 37818f2

Please sign in to comment.