From 1458a103962c4bfd8be0722f62d7d37777caac5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 14 Aug 2025 09:59:27 +0200 Subject: [PATCH] ci: Test with gnu and musl targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/ci.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 744e4ad..54dace0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,13 @@ jobs: strategy: 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: - uses: actions/checkout@v5 @@ -22,20 +28,23 @@ jobs: - run: ./scripts/install-protobuf.sh 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 # 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 clippy -p runc --all-targets -- -D warnings - - run: cargo check -p containerd-shim --all-targets - - run: cargo clippy -p containerd-shim --all-targets -- -D warnings + - run: cargo check -p runc --all-targets --target ${{ matrix.target }} + - run: cargo clippy -p runc --all-targets --target ${{ matrix.target }} -- -D warnings + - run: cargo check -p containerd-shim --all-targets --target ${{ matrix.target }} + - run: cargo clippy -p containerd-shim --all-targets --target ${{ matrix.target }} -- -D warnings # check the workspace - - run: cargo check --examples --tests --all-targets - - run: cargo check --examples --tests --all-targets --all-features - - run: cargo clippy --all-targets -- -D warnings - - run: cargo clippy --all-targets --all-features -- -D warnings + - run: cargo check --examples --tests --all-targets --target ${{ matrix.target }} + - run: cargo check --examples --tests --all-targets --all-features --target ${{ matrix.target }} + - run: cargo clippy --all-targets --target ${{ matrix.target }} -- -D warnings + - run: cargo clippy --all-targets --all-features --target ${{ matrix.target }} -- -D warnings - run: cargo doc --no-deps --features docs env: