Skip to content

Commit 2aba854

Browse files
nyuriktgross35
authored andcommitted
simplify clippy ci
(backport <#4411>) (cherry picked from commit 5997a8b)
1 parent e70b031 commit 2aba854

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ jobs:
3030
- name: Check style
3131
run: ./ci/style.sh
3232

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

ci/style.sh

Lines changed: 0 additions & 3 deletions
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 libc@1.0.0-alpha.1 -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

Lines changed: 0 additions & 7 deletions
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 const-extern-fn

0 commit comments

Comments
 (0)