@@ -25,25 +25,46 @@ jobs:
25
25
steps :
26
26
- uses : actions/checkout@v4
27
27
28
+ - run : |
29
+ if [[ "${{ matrix.linux-target }}" == "musl" ]]; then
30
+ # If we're using the musl target, we know we're
31
+ # running on the ubuntu-latest runner
32
+
33
+ sudo apt-get update
34
+ sudo apt-get -y install musl-tools musl-dev
35
+
36
+ mkdir -p ${HOME}/.cargo/
37
+ echo -e '[build]' > ${HOME}/.cargo/config.toml
38
+ echo -e 'target = "x86_64-unknown-linux-musl"' >> ${HOME}/.cargo/config.toml
39
+ echo -e 'rustflags = ["-C", "target-feature=+crt-static"]' >> ${HOME}/.cargo/config.toml
40
+ echo -e '[target.x86_64-unknown-linux-musl]' >> ${HOME}/.cargo/config.toml
41
+ echo -e 'linker = "musl-gcc"' >> ${HOME}/.cargo/config.toml
42
+ fi
43
+
44
+ rustup toolchain install nightly
45
+ rustup toolchain install nightly --component rustfmt
46
+ if [[ "${{ matrix.linux-target }}" == "musl" ]]; then
47
+ rustup target add x86_64-unknown-linux-musl --toolchain nightly
48
+ fi
49
+
28
50
- run : ./scripts/install-protobuf.sh
29
51
shell : bash
30
52
31
53
- run : |
32
- case ${{ matrix.os }} in
33
- macos-latest)
34
- rustup toolchain install nightly --component rustfmt
35
- ;;
54
+ case ${{ matrix.os }} in
36
55
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
38
60
;;
39
61
esac
40
- - run : cargo +nightly fmt --all -- --check
41
62
42
63
# the "runc" and "containerd-shim" crates have `sync` code that is not covered by the workspace
43
64
- run : cargo check -p runc --all-targets
44
65
- run : cargo clippy -p runc --all-targets -- -D warnings
45
66
- 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
47
68
48
69
# check the workspace
49
70
- run : cargo check --examples --tests --all-targets
0 commit comments