Skip to content

Commit 3019ec7

Browse files
committed
Add cache-key input for multi-workflow support
- Add cache-key input to differentiate frontend/backend workflows - Remove branch reference from cache key to share timings across branches - Cache is now shared across all branches by default
1 parent b714ca9 commit 3019ec7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ inputs:
1212
description: 'JSON file to store/read timings (default: .fairsplice-timings.json)'
1313
required: false
1414
default: '.fairsplice-timings.json'
15+
cache-key:
16+
description: 'Cache key for storing timings (use different keys for frontend/backend workflows)'
17+
required: false
18+
default: 'default'
1519
# split inputs
1620
pattern:
1721
description: 'Glob pattern to match test files (for split)'
@@ -57,9 +61,9 @@ runs:
5761
uses: actions/cache/restore@v4
5862
with:
5963
path: ${{ inputs.timings-file }}
60-
key: fairsplice-timings-${{ github.repository }}-${{ github.ref_name }}
64+
key: fairsplice-${{ inputs.cache-key }}-${{ github.repository }}
6165
restore-keys: |
62-
fairsplice-timings-${{ github.repository }}-
66+
fairsplice-${{ inputs.cache-key }}-${{ github.repository }}
6367
6468
- name: Run split
6569
id: split
@@ -105,4 +109,4 @@ runs:
105109
uses: actions/cache/save@v4
106110
with:
107111
path: ${{ inputs.timings-file }}
108-
key: fairsplice-timings-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_id }}
112+
key: fairsplice-${{ inputs.cache-key }}-${{ github.repository }}-${{ github.run_id }}

0 commit comments

Comments
 (0)