Skip to content

Commit 4eac647

Browse files
committed
ci: give each bpf-tests shard its own cache key
Previously all four matrix shards shared one rust-cache key and raced to save, leaving three failed reservations per run and only one entry that quickly aged out. Per-shard keys eliminate the race.
1 parent 3bc1cdc commit 4eac647

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/actions/install-rust/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
description: Comma-separated list of additional rustup components to install (e.g. "rustfmt, clippy").
66
required: false
77
default: ""
8+
cache-key:
9+
description: Extra value appended to the rust-cache key, used to give matrix shards distinct caches and avoid concurrent save races.
10+
required: false
11+
default: ""
812
runs:
913
using: composite
1014
steps:
@@ -16,3 +20,5 @@ runs:
1620
shell: bash
1721
run: echo "${{ inputs.components }}" | tr ',' '\n' | xargs rustup component add
1822
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
23+
with:
24+
key: ${{ inputs.cache-key }}

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ jobs:
100100
lfs: true
101101
submodules: true
102102
- uses: ./.github/actions/install-rust
103+
with:
104+
cache-key: ${{ matrix.test }}
103105
- name: Install dependencies required for libbpf-sys (vendored feature)
104106
run: sudo apt-get update && sudo apt-get install -y autopoint bison flex
105107

0 commit comments

Comments
 (0)