Skip to content

Commit 3449b3c

Browse files
committed
fixup! ci: Test with gnu and musl targets
1 parent 47cdef0 commit 3449b3c

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,42 @@ jobs:
2929
shell: bash
3030

3131
- run: |
32-
case ${{ matrix.os }} in
33-
macos-latest)
32+
case ${{ matrix.os }} in
33+
ubuntu-latest)
34+
if [[ "${{ matrix.linux-target }}" == "musl" ]]; then
35+
sudo apt-get update
36+
sudo apt-get -y install musl-tools musl-dev
37+
38+
mkdir -p ${HOME}/.cargo
39+
echo '[target.x86_64-unknown-linux-${{ matrix.linux-target }}]' > ${HOME}/.cargo/config.toml
40+
echo 'linker = "musl-gcc"' >> ${HOME}/.cargo/config.toml
41+
fi
42+
43+
rustup target add x86_64-unknown-linux-${{ matrix.linux-target }}
44+
rustup toolchain install nightly-x86_64-unknown-linux-${{ matrix.linux-target }} --force-non-host
45+
rustup toolchain install nightly-x86_64-unknown-linux-${{ matrix.linux-target }} --force-non-host --component rustfmt
46+
;;
47+
*)
48+
rustup toolchain install nightly
3449
rustup toolchain install nightly --component rustfmt
3550
;;
51+
esac
52+
shell: bash
53+
- run: |
54+
case ${{ matrix.os }} in
3655
ubuntu-latest)
37-
rustup toolchain install nightly --component rustfmt --target x86_64-unknown-linux-${{ matrix.linux-target }}
56+
cargo +nightly-x86_64-unknown-linux-${{ matrix.linux-target }} fmt --all -- --check
57+
;;
58+
*)
59+
cargo +nightly fmt --all -- --check
3860
;;
3961
esac
40-
- run: cargo +nightly fmt --all -- --check
4162
4263
# the "runc" and "containerd-shim" crates have `sync` code that is not covered by the workspace
4364
- run: cargo check -p runc --all-targets
4465
- run: cargo clippy -p runc --all-targets -- -D warnings
4566
- run: cargo check -p containerd-shim --all-targets
46-
- run: cargo clippy -p containerd-shim --all-targets -- -D warnings
67+
- run: cargo clippy -p containerd-shim --all-targets -- -D warnings
4768

4869
# check the workspace
4970
- run: cargo check --examples --tests --all-targets

0 commit comments

Comments
 (0)