Skip to content

Commit 106ebed

Browse files
committed
gh cache updated to use run_attempt
1 parent 4bb0b70 commit 106ebed

9 files changed

+19
-10
lines changed

.github/workflows/build_tests.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,16 @@ jobs:
9090
- uses: actions/setup-python@v5
9191
with:
9292
python-version: ${{ matrix.python-version }}
93-
93+
- name: Check if cache exists
94+
id: check-cache
95+
uses: actions/cache@v3
96+
with:
97+
path: |
98+
usr/local/bin/
99+
~/.cache/pip
100+
${{env.pythonLocation}}
101+
key: xpk-deps-${{ matrix.python-version }}-${{github.run_id }}-${{github.run_attempt}}
102+
lookup-only: true
94103
- name: install dependencies
95104
if : steps.check-cache.outputs.cache-hit != 'true'
96105
run: make install-lint && make install-dev && cp ./bin/kubectl-kueue /usr/local/bin/kubectl-kueue && cp ./bin/kubectl-kjob /usr/local/bin/kubectl-kjob
@@ -103,7 +112,7 @@ jobs:
103112
/usr/local/bin/kubectl-kjob
104113
~/.cache/pip
105114
${{env.pythonLocation}}
106-
key: xpk-deps-${{ matrix.python-version }}-${{needs.set-variables.outputs.run-id}}
115+
key: xpk-deps-${{ matrix.python-version }}-${{github.run_id }}-${{github.run_attempt}}
107116
linter:
108117
needs: [install-dependencies, set-variables]
109118
concurrency: # We support one build or nightly test to run at a time currently.

.github/workflows/reusable_cluster_create.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
/usr/local/bin/kubectl-kjob
6060
~/.cache/pip
6161
${{env.pythonLocation}}
62-
key: xpk-deps-3.10-${{inputs.run-id}}
62+
key: xpk-deps-3.10-${{github.run_id }}-${{github.run_attempt}}
6363
restore-keys: xpk-deps-3.10-
6464
- uses: 'google-github-actions/auth@v2'
6565
with:

.github/workflows/reusable_cluster_delete.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
/usr/local/bin/kubectl-kjob
5656
~/.cache/pip
5757
${{env.pythonLocation}}
58-
key: xpk-deps-3.10-${{inputs.run-id}}
58+
key: xpk-deps-3.10-${{github.run_id }}-${{github.run_attempt}}
5959
restore-keys: xpk-deps-3.10
6060
- name: Check xpk installation
6161
run: xpk --help

.github/workflows/reusable_cluster_private.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
/usr/local/bin/kubectl-kjob
6868
~/.cache/pip
6969
${{env.pythonLocation}}
70-
key: xpk-deps-3.10-${{inputs.run-id}}
70+
key: xpk-deps-3.10-${{github.run_id }}-${{github.run_attempt}}
7171
restore-keys: xpk-deps-3.10
7272
- name: Set Google Cloud CLI properties to a unused zone to verify --zone arg is passed properly in commands.
7373
run: |

.github/workflows/reusable_integration_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
/usr/local/bin/kubectl-kjob
4747
~/.cache/pip
4848
${{env.pythonLocation}}
49-
key: xpk-deps-3.10-${{inputs.run-id}}
49+
key: xpk-deps-3.10-${{github.run_id }}-${{github.run_attempt}}
5050
restore-keys: xpk-deps-3.10
5151
- name: "Set auth cidr"
5252
run: echo "AUTH_CIDR=$(curl api.ipify.org)/32" >> $GITHUB_ENV

.github/workflows/reusable_lint_and_format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
/usr/local/bin/kubectl-kjob
4444
~/.cache/pip
4545
${{env.pythonLocation}}
46-
key: xpk-deps-${{matrix.python-version}}-${{inputs.run-id}}
46+
key: xpk-deps-${{matrix.python-version}}-${{github.run_id }}-${{github.run_attempt}}
4747
restore-keys: xpk-deps-${{matrix.python-version}}-
4848
- name: Run pylint
4949
run: make pylint

.github/workflows/reusable_storage_tests_by_type.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
/usr/local/bin/kubectl-kjob
109109
~/.cache/pip
110110
${{env.pythonLocation}}
111-
key: xpk-deps-3.10-${{inputs.run-id}}
111+
key: xpk-deps-3.10-${{github.run_id }}-${{github.run_attempt}}
112112
restore-keys: xpk-deps-3.10-
113113
- name: Verify xpk installation
114114
run: xpk --help

.github/workflows/reusable_unit_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
/usr/local/bin/kubectl-kjob
3838
~/.cache/pip
3939
${{env.pythonLocation}}
40-
key: xpk-deps-3.10-${{inputs.run-id}}
40+
key: xpk-deps-3.10-${{github.run_id }}-${{github.run_attempt}}
4141
restore-keys: xpk-deps-3.10-
4242
# - name: Install dependecies
4343
# run: make install-dev

.github/workflows/reusable_workload_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
/usr/local/bin/kubectl-kjob
6060
~/.cache/pip
6161
${{env.pythonLocation}}
62-
key: xpk-deps-3.10-${{inputs.run-id}}
62+
key: xpk-deps-3.10-${{github.run_id }}-${{github.run_attempt}}
6363
restore-keys: xpk-deps-3.10-
6464
- name: Set Google Cloud CLI properties to a unused zone to verify --zone arg is passed properly in commands.
6565
run: |

0 commit comments

Comments
 (0)