From c383b5b73130cb49e17135fc4b28b26e94e55e61 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Wed, 12 Apr 2023 09:35:32 +0200 Subject: [PATCH] workflows: Run clippy for user space and eBPF crates separately Clippy triggers builds for the checked crates. Without any additional arguments, it does so with the default toolchain for the default target. The default target for x86_64 hosts is x86_64-unknown-linux-gnu. Also, lack of additional arguments means using the std library. To avoid issues coming from compiling eBPF crates for x86_64 target and with std (like [0]), this change ensures that they are checked with `--target bpfel-unknown-none` and `-Zbuild-std=core` options. [0] https://github.com/aya-rs/aya/actions/runs/4669677849/jobs/8268452592 --- .github/workflows/lint.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index afe47cf0..17ec5b32 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,10 +31,33 @@ jobs: run: | cargo fmt --all -- --check - - name: Run clippy + - name: Run clippy (for user space crates) run: | - cargo clippy --workspace --exclude integration-test -- --deny warnings + cargo clippy --workspace \ + --exclude integration-test \ + --exclude aya-bpf \ + --exclude aya-bpf-bindings \ + --exclude aya-log-ebpf \ + --exclude integration-ebpf \ + -- --deny warnings + + - name: Run clippy (for eBPF crates) + run: | + cargo +nightly clippy \ + --target bpfel-unknown-none -Zbuild-std=core \ + --workspace \ + --exclude aya \ + --exclude aya-obj \ + --exclude aya-tool \ + --exclude aya-log \ + --exclude aya-log-parser \ + --exclude integration-test \ + --exclude integration-test-macros \ + --exclude xtask \ + --exclude aya-bpf-macros \ + --exclude aya-log-ebpf-macros \ + -- --deny warnings - name: Run miri run: | - cargo miri test --all-targets \ No newline at end of file + cargo miri test --all-targets