Skip to content

Commit 72c8e83

Browse files
authored
ci: stabilize Blacksmith sticky disk cache keys (#538)
1 parent 2771a2e commit 72c8e83

8 files changed

Lines changed: 20 additions & 29 deletions

File tree

.github/actions/mount-sticky-cache/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Mount Blacksmith sticky disks for large CI caches.
33

44
inputs:
55
key-prefix:
6-
description: Prefix shared by all sticky disk keys mounted by this action.
6+
description: Stable namespace for job-specific sticky disks.
77
required: true
88
cargo:
99
description: Mount Cargo registry and git caches.
@@ -22,33 +22,33 @@ runs:
2222
if: inputs.cargo == 'true'
2323
uses: ./.github/actions/stickydisk
2424
with:
25-
key: ${{ inputs.key-prefix }}-cargo-registry
25+
key: ${{ github.repository }}-cargo-registry-${{ runner.os }}-${{ runner.arch }}
2626
path: ~/.cargo/registry
2727

2828
- name: Mount Cargo git
2929
if: inputs.cargo == 'true'
3030
uses: ./.github/actions/stickydisk
3131
with:
32-
key: ${{ inputs.key-prefix }}-cargo-git
32+
key: ${{ github.repository }}-cargo-git-${{ runner.os }}-${{ runner.arch }}
3333
path: ~/.cargo/git
3434

3535
- name: Mount Cargo target
3636
if: inputs.target != ''
3737
uses: ./.github/actions/stickydisk
3838
with:
39-
key: ${{ inputs.key-prefix }}-cargo-target
39+
key: ${{ inputs.key-prefix }}-cargo-target-${{ runner.os }}-${{ runner.arch }}
4040
path: ${{ inputs.target }}
4141

4242
- name: Mount Playwright browsers
4343
if: inputs.browsers == 'true'
4444
uses: ./.github/actions/stickydisk
4545
with:
46-
key: ${{ inputs.key-prefix }}-playwright-browsers
46+
key: ${{ inputs.key-prefix }}-playwright-browsers-${{ runner.os }}-${{ runner.arch }}
4747
path: ~/.cache/ms-playwright
4848

4949
- name: Mount Puppeteer browsers
5050
if: inputs.browsers == 'true'
5151
uses: ./.github/actions/stickydisk
5252
with:
53-
key: ${{ inputs.key-prefix }}-puppeteer-browsers
53+
key: ${{ inputs.key-prefix }}-puppeteer-browsers-${{ runner.os }}-${{ runner.arch }}
5454
path: ~/.cache/puppeteer

.github/workflows/benchmark-docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ permissions:
3030
env:
3131
CARGO_TERM_COLOR: always
3232
OX_CONTENT_BENCHMARK_RUNNER: blacksmith-32vcpu-ubuntu-2404
33-
STICKY_CACHE_SCOPE: ${{ github.ref_name }}
3433

3534
jobs:
3635
refresh:
@@ -59,7 +58,7 @@ jobs:
5958
- name: Mount sticky cache
6059
uses: ./.github/actions/mount-sticky-cache
6160
with:
62-
key-prefix: ${{ github.repository }}-benchmark-docs-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
61+
key-prefix: ${{ github.repository }}-benchmark-docs-${{ github.job }}
6362
cargo: "true"
6463
target: target
6564

.github/workflows/benchmark.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ env:
1515
CARGO_TERM_COLOR: always
1616
OX_CONTENT_BENCHMARK_RUNNER: blacksmith-32vcpu-ubuntu-2404
1717
OX_CONTENT_BENCHMARK_RUNS: "5"
18-
STICKY_CACHE_SCOPE: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}
1918

2019
jobs:
2120
benchmark:
@@ -71,7 +70,7 @@ jobs:
7170
- name: Mount sticky cache
7271
uses: ./.github/actions/mount-sticky-cache
7372
with:
74-
key-prefix: ${{ github.repository }}-benchmark-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
73+
key-prefix: ${{ github.repository }}-benchmark-${{ github.job }}
7574
cargo: "true"
7675
target: /tmp/ox-content-cargo-target
7776

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ concurrency:
1515

1616
env:
1717
CARGO_TERM_COLOR: always
18-
STICKY_CACHE_SCOPE: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}
1918

2019
jobs:
2120
rustfmt:
@@ -50,7 +49,7 @@ jobs:
5049
- name: Mount sticky cache
5150
uses: ./.github/actions/mount-sticky-cache
5251
with:
53-
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
52+
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
5453
cargo: "true"
5554
target: target
5655

@@ -96,7 +95,7 @@ jobs:
9695
- name: Mount sticky cache
9796
uses: ./.github/actions/mount-sticky-cache
9897
with:
99-
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
98+
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
10099
cargo: "true"
101100
target: target
102101

@@ -127,7 +126,7 @@ jobs:
127126
- name: Mount sticky cache
128127
uses: ./.github/actions/mount-sticky-cache
129128
with:
130-
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
129+
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
131130
cargo: "true"
132131
target: target
133132

@@ -182,7 +181,7 @@ jobs:
182181
- name: Mount sticky cache
183182
uses: ./.github/actions/mount-sticky-cache
184183
with:
185-
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
184+
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
186185
cargo: "true"
187186

188187
- name: Install Cargo audit tools
@@ -221,7 +220,7 @@ jobs:
221220
- name: Mount sticky cache
222221
uses: ./.github/actions/mount-sticky-cache
223222
with:
224-
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
223+
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
225224
cargo: "true"
226225
target: target
227226

@@ -263,7 +262,7 @@ jobs:
263262
if: startsWith(matrix.os, 'blacksmith-')
264263
uses: ./.github/actions/mount-sticky-cache
265264
with:
266-
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ matrix.os }}-${{ env.STICKY_CACHE_SCOPE }}
265+
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ matrix.os }}
267266
cargo: "true"
268267
target: target
269268

@@ -316,7 +315,7 @@ jobs:
316315
- name: Mount sticky cache
317316
uses: ./.github/actions/mount-sticky-cache
318317
with:
319-
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
318+
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
320319
cargo: "true"
321320
target: target
322321
browsers: "true"

.github/workflows/deploy.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ concurrency:
1212
group: pages
1313
cancel-in-progress: false
1414

15-
env:
16-
STICKY_CACHE_SCOPE: ${{ github.ref_name }}
17-
1815
jobs:
1916
build:
2017
runs-on: blacksmith-32vcpu-ubuntu-2404
@@ -36,7 +33,7 @@ jobs:
3633
- name: Mount sticky cache
3734
uses: ./.github/actions/mount-sticky-cache
3835
with:
39-
key-prefix: ${{ github.repository }}-deploy-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
36+
key-prefix: ${{ github.repository }}-deploy-${{ github.job }}
4037
cargo: "true"
4138
target: target
4239
browsers: "true"

.github/workflows/nightly.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ permissions:
3131
env:
3232
CARGO_TERM_COLOR: always
3333
LINUX_GLIBC_VERSION: "2.17"
34-
STICKY_CACHE_SCOPE: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}
3534

3635
jobs:
3736
build-napi:
@@ -85,7 +84,7 @@ jobs:
8584
if: startsWith(matrix.os, 'blacksmith-')
8685
uses: ./.github/actions/mount-sticky-cache
8786
with:
88-
key-prefix: ${{ github.repository }}-nightly-${{ github.job }}-${{ matrix.target }}-${{ env.STICKY_CACHE_SCOPE }}
87+
key-prefix: ${{ github.repository }}-nightly-${{ github.job }}-${{ matrix.target }}
8988
cargo: "true"
9089
target: target
9190

@@ -270,7 +269,7 @@ jobs:
270269
- name: Mount sticky cache
271270
uses: ./.github/actions/mount-sticky-cache
272271
with:
273-
key-prefix: ${{ github.repository }}-nightly-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
272+
key-prefix: ${{ github.repository }}-nightly-${{ github.job }}
274273
cargo: "true"
275274
target: target
276275

.github/workflows/testbox.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ permissions:
1818

1919
env:
2020
CARGO_TERM_COLOR: always
21-
STICKY_CACHE_SCOPE: ${{ github.ref_name }}
2221
# begin-testbox / run-testbox are JavaScript actions that require Node 24.
2322
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
2423

@@ -61,7 +60,7 @@ jobs:
6160
- name: Mount sticky cache
6261
uses: ./.github/actions/mount-sticky-cache
6362
with:
64-
key-prefix: ${{ github.repository }}-testbox-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
63+
key-prefix: ${{ github.repository }}-testbox-${{ github.job }}
6564
cargo: "true"
6665
target: target
6766
browsers: "true"

.github/workflows/void-deploy.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ permissions:
1818
contents: read
1919

2020
env:
21-
STICKY_CACHE_SCOPE: ${{ github.ref_name }}
2221
VOID_API_URL: ${{ vars.VOID_API_URL || 'https://api.void.cloud' }}
2322
VOID_PROJECT: ${{ vars.VOID_PROJECT || 'ox-content' }}
2423
OX_CONTENT_DOCS_BASE: /
@@ -46,7 +45,7 @@ jobs:
4645
- name: Mount sticky cache
4746
uses: ./.github/actions/mount-sticky-cache
4847
with:
49-
key-prefix: ${{ github.repository }}-void-deploy-${{ github.job }}-${{ env.STICKY_CACHE_SCOPE }}
48+
key-prefix: ${{ github.repository }}-void-deploy-${{ github.job }}
5049
cargo: "true"
5150
target: target
5251
browsers: "true"

0 commit comments

Comments
 (0)