Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
description: Comma-separated list of additional rustup components to install (e.g. "rustfmt, clippy").
required: false
default: ""
cache-key:
description: Extra value appended to the rust-cache key, used to give matrix shards distinct caches and avoid concurrent save races.
required: false
default: ""
runs:
using: composite
steps:
Expand All @@ -16,3 +20,5 @@ runs:
shell: bash
run: echo "${{ inputs.components }}" | tr ',' '\n' | xargs rustup component add
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
key: ${{ inputs.cache-key }}
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,21 @@ jobs:

bpf-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Each memtrack integration test binary runs its cases serially
# (eBPF tracker can't overlap with itself in one process), so we
# shard at the test-binary level to parallelize across jobs.
test: [c_tests, cpp_tests, rust_tests, spawn_tests]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
lfs: true
submodules: true
- uses: ./.github/actions/install-rust
with:
cache-key: ${{ matrix.test }}
- name: Install dependencies required for libbpf-sys (vendored feature)
run: sudo apt-get update && sudo apt-get install -y autopoint bison flex

Expand All @@ -102,7 +111,7 @@ jobs:
- name: Run tests
env:
RUST_LOG: debug
run: sudo -E $(which cargo) test -- --test-threads 1 --nocapture
run: sudo -E $(which cargo) test --lib --test ${{ matrix.test }} -- --test-threads 1 --nocapture
working-directory: crates/memtrack

# Since we ran the tests with sudo, the build artifacts will have root ownership
Expand Down