@@ -25,25 +25,53 @@ jobs:
25
25
steps :
26
26
- uses : actions/checkout@v4
27
27
28
+ - run : |
29
+ if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
30
+ if [[ "${{ matrix.linux-target }}" == "musl" ]]; then
31
+ sudo apt-get remove rustup || true
32
+ rustup self uninstall -y || true
33
+ rm -rf ${HOME}/.cargo ${HOME}/.rustup
34
+
35
+ curl https://sh.rustup.rs -sSf | sh -s -- -y
36
+ source $HOME/.cargo/env
37
+
38
+ sudo apt-get update
39
+ sudo apt-get -y install musl-tools musl-dev
40
+ fi
41
+
42
+ rustup target add x86_64-unknown-linux-${{ matrix.linux-target }}
43
+ mkdir -p ${HOME}/.cargo/
44
+ echo -e '[build]' > ${HOME}/.cargo/config.toml
45
+ echo -e 'target = "x86_64-unknown-linux-${{ matrix.linux-target }}"' >> ${HOME}/.cargo/config.toml
46
+ if [[ "${{ matrix.linux-target }}" == "musl" ]]; then
47
+ echo -e 'rustflags = ["-C", "target-feature=+crt-static"]' >> ${HOME}/.cargo/config.toml
48
+ echo -e '[target.x86_64-unknown-linux-musl]' >> ${HOME}/.cargo/config.toml
49
+ echo -e 'linker = "musl-gcc"' >> ${HOME}/.cargo/config.toml
50
+ fi
51
+ cat ${HOME}/.cargo/config.toml
52
+ fi
53
+
54
+ rustup toolchain install nightly
55
+ rustup toolchain install nightly --component rustfmt
56
+
28
57
- run : ./scripts/install-protobuf.sh
29
58
shell : bash
30
59
31
60
- run : |
32
- case ${{ matrix.os }} in
33
- macos-latest)
34
- rustup toolchain install nightly --component rustfmt
35
- ;;
61
+ case ${{ matrix.os }} in
36
62
ubuntu-latest)
37
- rustup toolchain install nightly --component rustfmt --target x86_64-unknown-linux-${{ matrix.linux-target }}
63
+ cargo +nightly-x86_64-unknown-linux-${{ matrix.linux-target }} fmt --all -- --check
64
+ ;;
65
+ *)
66
+ cargo +nightly fmt --all -- --check
38
67
;;
39
68
esac
40
- - run : cargo +nightly fmt --all -- --check
41
69
42
70
# the "runc" and "containerd-shim" crates have `sync` code that is not covered by the workspace
43
71
- run : cargo check -p runc --all-targets
44
72
- run : cargo clippy -p runc --all-targets -- -D warnings
45
73
- run : cargo check -p containerd-shim --all-targets
46
- - run : cargo clippy -p containerd-shim --all-targets -- -D warnings
74
+ - run : cargo clippy -p containerd-shim --all-targets -- -D warnings
47
75
48
76
# check the workspace
49
77
- run : cargo check --examples --tests --all-targets
0 commit comments