Run clippy in CI

Install Rust stable *after* nightly so that the default is stable.
reviewable/pr124/r1
Tamir Duberstein 3 months ago
parent ee45752006
commit 4da4bf4729

@ -45,23 +45,18 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install latest stable - uses: dtolnay/rust-toolchain@nightly
uses: dtolnay/rust-toolchain@master
with: with:
toolchain: stable components: rust-src
- name: Install latest nightly - uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@master
with: with:
toolchain: nightly components: clippy
components: rust-src
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: Install deps - uses: taiki-e/install-action@v2
uses: taiki-e/install-action@v2
with: with:
tool: bpf-linker,cargo-generate tool: bpf-linker,cargo-generate
- name: Run tests - run: ./test.sh ${{ github.workspace }} ${{ matrix.program }}
run: ./test.sh ${{ github.workspace }} ${{ matrix.program }}

@ -53,5 +53,11 @@ cargo generate --path "${TEMPLATE_DIR}" -n test -d program_type="${PROG_TYPE}" $
pushd test pushd test
cargo xtask build cargo xtask build
cargo xtask build --release cargo xtask build --release
# We cannot run clippy over the whole workspace at once due to feature unification. Since both test
# and test-ebpf both depend on test-common and test activates test-common's aya dependency, we end
# up trying to compile the panic handler twice: once from the bpf program, and again from std via
# aya.
cargo clippy --exclude test-ebpf --all-targets --workspace -- --deny warnings
cargo clippy --package test-ebpf --all-targets -- --deny warnings
popd popd
exit 0 exit 0

@ -269,7 +269,7 @@ use aya_ebpf::{
#[socket_filter] #[socket_filter]
pub fn {{crate_name}}(_ctx: SkBuffContext) -> i64 { pub fn {{crate_name}}(_ctx: SkBuffContext) -> i64 {
return 0 0
} }
{%- when "cgroup_sysctl" %} {%- when "cgroup_sysctl" %}
use aya_ebpf::{ use aya_ebpf::{

Loading…
Cancel
Save