4242 msrv : ${{ steps.definitions.outputs.msrv }}
4343 examples : ${{ steps.definitions.outputs.examples }}
4444 crates : ${{ steps.definitions.outputs.crates }}
45+ workspaces : ${{ steps.definitions.outputs.workspaces }}
4546 steps :
4647 - uses : actions/checkout@v4
4748 # examples is populated by
7677 export CRATES=$(find quic common -name *Cargo.toml | jq -R | jq -s | jq '. += ["tools/xdp/s2n-quic-xdp/Cargo.toml","dc/s2n-quic-dc/Cargo.toml"]' | jq -c)
7778 echo "crates=$CRATES"
7879 echo "crates=$CRATES" >> $GITHUB_OUTPUT
80+ export WORKSPACES=$(find . -maxdepth 4 -name Cargo.toml -not -path './tools/xdp/ebpf/*' -exec grep -l '^\[workspace\]' {} \; | xargs -n1 dirname | sort | jq -R | jq -sc)
81+ echo "workspaces=$WORKSPACES"
82+ echo "workspaces=$WORKSPACES" >> $GITHUB_OUTPUT
7983
8084 rustfmt :
8185 runs-on : ubuntu-latest
@@ -96,14 +100,7 @@ jobs:
96100
97101 clippy :
98102 runs-on : ubuntu-latest
99- strategy :
100- fail-fast : false
101- matrix :
102- include :
103- - toolchain : stable
104- # fail on stable warnings
105- args : " -D warnings"
106- - toolchain : beta
103+ needs : env
107104 steps :
108105 - uses : actions/checkout@v4
109106 with :
@@ -112,15 +109,21 @@ jobs:
112109 - name : Install rust toolchain
113110 id : toolchain
114111 run : |
115- rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component clippy
116- rustup override set ${{ matrix.toolchain }}
112+ rustup toolchain install stable --profile minimal --component clippy
113+ rustup override set stable
117114
118115 - uses : camshaft/rust-cache@v1
119116
120117 # TODO translate json reports to in-action warnings
121- - name : Run cargo clippy
118+ - name : Run cargo clippy on all workspaces
122119 run : |
123- cargo clippy --all-features --all-targets --workspace -- ${{ matrix.args }}
120+ WORKSPACES=$(echo '${{ needs.env.outputs.workspaces }}' | jq -r '.[]')
121+ for workspace in $WORKSPACES; do
122+ echo "Running clippy on $workspace"
123+ cd "$workspace"
124+ cargo clippy --all-features --all-targets --workspace -- -D warnings
125+ cd $GITHUB_WORKSPACE
126+ done
124127
125128 udeps :
126129 runs-on : ubuntu-latest
@@ -522,10 +525,6 @@ jobs:
522525 working-directory : ${{ matrix.example }}
523526 run : cargo +nightly fmt --all -- --check
524527
525- - name : lint
526- working-directory : ${{ matrix.example }}
527- run : cargo clippy --all-features --all-targets -- -D warnings
528-
529528 # not all examples will build with the --manifest-path argument, since the
530529 # manifest-path argument will pull configuration from the current directory
531530 # instead of the directory with the Cargo.toml file
@@ -884,7 +883,7 @@ jobs:
884883 - name : Install rust toolchain
885884 id : toolchain
886885 run : |
887- rustup toolchain install stable --profile minimal --component clippy, rustfmt
886+ rustup toolchain install stable --profile minimal --component rustfmt
888887 rustup override set stable
889888
890889 - uses : camshaft/install@v1
@@ -893,10 +892,6 @@ jobs:
893892
894893 - uses : camshaft/rust-cache@v1
895894
896- - name : Run clippy
897- working-directory : tools/xdp
898- run : cargo +stable clippy
899-
900895 - name : Build ebpf
901896 working-directory : tools/xdp
902897 env :
@@ -917,7 +912,7 @@ jobs:
917912 - name : Install rust toolchain
918913 working-directory : dc/wireshark
919914 run : |
920- rustup toolchain install stable --profile minimal --component clippy, rustfmt
915+ rustup toolchain install stable --profile minimal --component rustfmt
921916 rustup override set stable
922917
923918 - uses : camshaft/install@v1
@@ -935,10 +930,6 @@ jobs:
935930 working-directory : dc/wireshark
936931 run : cargo fmt --all -- --check
937932
938- - name : Run clippy
939- working-directory : dc/wireshark
940- run : cargo clippy --tests
941-
942933 - name : Run tests
943934 working-directory : dc/wireshark
944935 run : cargo xtask test
0 commit comments