Skip to content

Commit 5997a8b

Browse files
committed
simplify clippy ci
1 parent bea4d1b commit 5997a8b

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.github/workflows/ci.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ jobs:
2929
- name: Check style
3030
run: ./ci/style.sh
3131

32+
clippy:
33+
name: Clippy check
34+
runs-on: ubuntu-24.04
35+
timeout-minutes: 10
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: Swatinem/rust-cache@v2
39+
# Here we use the latest stable Rust toolchain already installed by GitHub
40+
# Ideally we should run it for every target, but we cannot rely on unstable toolchains
41+
# due to Clippy not being consistent between them.
42+
- run: cargo clippy --workspace --exclude libc-test --exclude ctest-test --all-targets -- -D warnings
43+
3244
# This runs `cargo build --target ...` for all T1 and T2 targets`
3345
verify_build:
3446
name: Verify build

ci/style.sh

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ set -eux
44

55
[ -n "${CI:-}" ] && check="--check"
66

7-
# TODO: for some reason using `--workspace` validates a lot of generated code in ./target/** dir
8-
cargo clippy -p [email protected] -p ctest --all-targets -- -D warnings
9-
107
cargo test --manifest-path libc-test/Cargo.toml --test style -- --nocapture
118

129
command -v rustfmt

ci/verify-build.sh

-7
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,9 @@ test_target() {
4444
# The basic command that is run each time
4545
cmd="cargo +$rust build --target $target"
4646

47-
# The basic clippy command
48-
clippy_cmd="cargo +$rust clippy --all-targets --target $target"
49-
5047
if [ "${no_dist}" != "0" ]; then
5148
# If we can't download a `core`, we need to build it
5249
cmd="$cmd -Zbuild-std=core,alloc"
53-
clippy_cmd="$clippy_cmd -Zbuild-std=core,alloc"
5450

5551
# FIXME: With `build-std` feature, `compiler_builtins` emits a lof of lint warnings.
5652
RUSTFLAGS="${RUSTFLAGS:-} -Aimproper_ctypes_definitions"
@@ -71,9 +67,6 @@ test_target() {
7167
done
7268
fi
7369

74-
# Run cargo clippy first
75-
$clippy_cmd
76-
7770
# Test with expected combinations of features
7871
$cmd
7972
$cmd --features extra_traits

0 commit comments

Comments
 (0)