Skip to content

Add bounded route dossiers and interactive field guide #65

Add bounded route dossiers and interactive field guide

Add bounded route dossiers and interactive field guide #65

Workflow file for this run

name: ci
on:
push:
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
msrv:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- name: Install eBPF build prerequisites
run: |
sudo apt-get update
sudo apt-get install --yes linux-tools-generic clang llvm libelf-dev libpcap-dev pkg-config
bpftool_bin="$(find /usr/lib -type f -name bpftool -print -quit)"
test -n "$bpftool_bin"
echo "$(dirname "$bpftool_bin")" >> "$GITHUB_PATH"
"$bpftool_bin" version
- name: Install minimum supported Rust
uses: dtolnay/rust-toolchain@1.85.0
- name: Cache Cargo artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: msrv-1.85
- name: Fetch locked dependencies
run: cargo fetch --locked
- name: Check minimum supported Rust
run: cargo check --workspace --all-features --locked --offline
verify:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- name: Install eBPF build prerequisites
run: |
sudo apt-get update
sudo apt-get install --yes linux-tools-generic clang llvm libelf-dev libpcap-dev pkg-config
bpftool_bin="$(find /usr/lib -type f -name bpftool -print -quit)"
test -n "$bpftool_bin"
echo "$(dirname "$bpftool_bin")" >> "$GITHUB_PATH"
"$bpftool_bin" version
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- name: Cache Cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Fetch locked dependencies
run: cargo fetch --locked
- name: Validate agent plugin catalogs
run: python3 scripts/validate-agent-plugin.py
- name: Check formatting
run: cargo fmt --all -- --check
- name: Test all features
run: cargo test --workspace --all-features --locked --offline
- name: Reject lint warnings
run: cargo clippy --workspace --all-targets --all-features --locked --offline -- -D warnings
- name: Build release binary
run: cargo build --release --locked --offline
- name: Verify crates.io package contents
run: |
cargo package --workspace --locked --offline --no-verify
tar -tf target/package/skbx-sensor-*.crate |
grep -q 'skbx-sensor-.*/bpf/skbx.bpf.c'
tar -tf target/package/skbx-sensor-*.crate |
grep -q 'skbx-sensor-.*/bpf/include/bpf_helpers.h'
- name: Verify documented Cargo install
env:
CARGO_INSTALL_ROOT: ${{ runner.temp }}/skbx-cargo-install
run: |
cargo install \
--git "file://$GITHUB_WORKSPACE" \
--rev "$GITHUB_SHA" \
--locked \
--root "$CARGO_INSTALL_ROOT" \
skbx-cli
cargo install \
--git "file://$GITHUB_WORKSPACE" \
--rev "$GITHUB_SHA" \
--locked \
--root "$CARGO_INSTALL_ROOT" \
skbx-route
version="$(cargo metadata --no-deps --format-version 1 |
jq -r '.packages[] | select(.name == "skbx-cli") | .version')"
"$CARGO_INSTALL_ROOT/bin/skbx" describe --format json | jq -e --arg version "$version" '
.name == "skbx"
and .version == $version
and .contract_version == "traceq/0.1.0"
'
"$CARGO_INSTALL_ROOT/bin/skbx-route" describe | jq -e --arg version "$version" '
.name == "skbx-route"
and .version == $version
and .contract_version == "routeq/0.1.0"
'
- name: Verify agent contract
run: |
target/release/skbx describe --format json | jq -e '
.contract_version == "traceq/0.1.0"
and .defaults.max_events == 100000
and (.capabilities | length > 0)
'
target/release/skbx schema | jq -e '
."$schema" == "https://json-schema.org/draft/2020-12/schema"
and ."$defs".EventEnvelope
'
target/release/skbx-route describe | jq -e '
.contract_version == "routeq/0.1.0"
and .limits.max_packets == 256
and (.invariants | index("a silent hop is unknown and is not labeled as a drop"))
'
route_file="$RUNNER_TEMP/demo.routeq.jsonl"
target/release/skbx-route demo --output "$route_file"
target/release/skbx-route replay "$route_file" --format json | jq -e '
.hops == 4
and .responsive_hops == 3
and .destination_reached == true
and .complete == true
'
- name: Verify embedded eBPF metadata
run: |
object="$(find target/release/build -path '*/out/skbx.bpf.o' -print -quit)"
test -n "$object"
llvm-readelf --sections "$object" | grep -q '\.BTF'
llvm-readelf --sections "$object" | grep -q '\.BTF\.ext'