Skip to content

kconfigs: set CONFIG_BPF_LSM=y #56

kconfigs: set CONFIG_BPF_LSM=y

kconfigs: set CONFIG_BPF_LSM=y #56

Workflow file for this run

name: Test
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: '-D warnings'
jobs:
build:
name: Build & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build & test
run: |
cargo build --lib
cargo test
clippy:
name: Lint with clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo clippy --no-deps --all-targets -- -A unknown_lints -D clippy::todo
rustfmt:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo +nightly fmt --all -- --check
cargo-doc:
name: Generate documentation
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: '-D warnings'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo doc --no-deps
test-libbpf-rs:
# check that libbpf-rs, one of the main consumers of the library, works with
# this version
name: Test libbpf-rs integration
runs-on: ubuntu-latest
# This test is just informative; certain failures *may* be expected.
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout libbpf-rs
uses: actions/checkout@v4
with:
repository: libbpf/libbpf-rs
path: libbpf-rs
- name: Install development dependencies
run: sudo apt-get update -y && sudo apt-get install -y gcc-multilib libelf-dev zlib1g-dev
- name: Build libbpf-rs
run: |
dir=$(pwd)
cd libbpf-rs
# Patch the vmlinux.h version in use.
cat >> Cargo.toml <<EOF
[patch."https://github.com/libbpf/vmlinux.h.git"]
vmlinux = { path = "${dir}" }
EOF
cargo update
cargo check --tests
generate-headers:
name: Generate vmlinux.h headers
uses: ./.github/workflows/vmlinux.h.yml
check-headers:
name: Check headers are up to date
runs-on: ubuntu-latest
needs: generate-headers
steps:
- uses: actions/checkout@v4
- name: Download generated headers
uses: actions/download-artifact@v4
with:
name: vmlinux.h
path: generated-headers
- name: Copy headers to include/ directory
shell: bash
run: |
# Copy each vmlinux.h file to the corresponding include/ subdirectory
for dir in generated-headers/*/; do
arch=$(basename "$dir")
cp "$dir"vmlinux.h "include/$arch/"
done
- name: Check for differences
run: git diff --exit-code ||
(echo "!!!! CHECKED IN vmlinux.h HEADER IS OUTDATED !!!!" && false)