diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2385f1..f4d40e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,23 +45,18 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install latest stable - uses: dtolnay/rust-toolchain@master + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: stable + components: rust-src - - name: Install latest nightly - uses: dtolnay/rust-toolchain@master + - uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly - components: rust-src + components: clippy - uses: Swatinem/rust-cache@v2 - - name: Install deps - uses: taiki-e/install-action@v2 + - uses: taiki-e/install-action@v2 with: tool: bpf-linker,cargo-generate - - name: Run tests - run: ./test.sh ${{ github.workspace }} ${{ matrix.program }} + - run: ./test.sh ${{ github.workspace }} ${{ matrix.program }} diff --git a/test.sh b/test.sh index 32aea76..87a7e6a 100755 --- a/test.sh +++ b/test.sh @@ -53,5 +53,11 @@ cargo generate --path "${TEMPLATE_DIR}" -n test -d program_type="${PROG_TYPE}" $ pushd test cargo xtask build 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 exit 0 diff --git a/{{project-name}}-ebpf/src/main.rs b/{{project-name}}-ebpf/src/main.rs index b599724..9a0a61f 100644 --- a/{{project-name}}-ebpf/src/main.rs +++ b/{{project-name}}-ebpf/src/main.rs @@ -269,7 +269,7 @@ use aya_ebpf::{ #[socket_filter] pub fn {{crate_name}}(_ctx: SkBuffContext) -> i64 { - return 0 + 0 } {%- when "cgroup_sysctl" %} use aya_ebpf::{