ci: Test with gnu and musl targets

Then we can ensure we don't end up with a similar issue that happend
with containerd-shim-protos not being buildable with musl on 0.9.0.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
This commit is contained in:
Fabiano Fidêncio 2025-08-14 09:59:27 +02:00 committed by Maksym Pavlenko
parent e08126e522
commit 1458a10396
1 changed files with 19 additions and 10 deletions

View File

@ -14,7 +14,13 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: macos-latest
target: aarch64-apple-darwin
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
@ -22,20 +28,23 @@ jobs:
- run: ./scripts/install-protobuf.sh - run: ./scripts/install-protobuf.sh
shell: bash shell: bash
- run: rustup toolchain install nightly --component rustfmt - if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get update && sudo apt-get install -y musl-tools && rustup target add x86_64-unknown-linux-musl
- run: rustup toolchain install nightly --component rustfmt --target ${{ matrix.target }}
- run: cargo +nightly fmt --all -- --check - run: cargo +nightly fmt --all -- --check
# the "runc" and "containerd-shim" crates have `sync` code that is not covered by the workspace # the "runc" and "containerd-shim" crates have `sync` code that is not covered by the workspace
- run: cargo check -p runc --all-targets - run: cargo check -p runc --all-targets --target ${{ matrix.target }}
- run: cargo clippy -p runc --all-targets -- -D warnings - run: cargo clippy -p runc --all-targets --target ${{ matrix.target }} -- -D warnings
- run: cargo check -p containerd-shim --all-targets - run: cargo check -p containerd-shim --all-targets --target ${{ matrix.target }}
- run: cargo clippy -p containerd-shim --all-targets -- -D warnings - run: cargo clippy -p containerd-shim --all-targets --target ${{ matrix.target }} -- -D warnings
# check the workspace # check the workspace
- run: cargo check --examples --tests --all-targets - run: cargo check --examples --tests --all-targets --target ${{ matrix.target }}
- run: cargo check --examples --tests --all-targets --all-features - run: cargo check --examples --tests --all-targets --all-features --target ${{ matrix.target }}
- run: cargo clippy --all-targets -- -D warnings - run: cargo clippy --all-targets --target ${{ matrix.target }} -- -D warnings
- run: cargo clippy --all-targets --all-features -- -D warnings - run: cargo clippy --all-targets --all-features --target ${{ matrix.target }} -- -D warnings
- run: cargo doc --no-deps --features docs - run: cargo doc --no-deps --features docs
env: env: