Skip to content

Commit 00a63ca

Browse files
committed
switch to use github cache to improve reuse
1 parent 8a6738b commit 00a63ca

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

.github/actions/setup/action.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ runs:
5555
5656
- name: Download CTK cache
5757
id: ctk-get-cache
58-
uses: actions/download-artifact@v4
58+
uses: actions/cache/restore@v4
5959
continue-on-error: true
6060
with:
61-
name: ${{ env.CTK_CACHE_KEY }}
62-
path: ./
61+
key: ${{ env.CTK_CACHE_KEY }}
62+
path: ${{ env.CTK_CACHE_FILENAME }}
6363

6464
- name: Get CUDA components
65-
if: ${{ steps.ctk-get-cache.outcome == 'failure' }}
65+
if: ${{ steps.ctk-get-cache.outputs.cache-hit != 'true' }}
6666
shell: bash --noprofile --norc -xeuo pipefail {0}
6767
run: |
6868
CUDA_PATH="./cuda_toolkit"
@@ -123,16 +123,15 @@ runs:
123123
# so setting the CUDA_PATH env var here is meaningless.
124124
125125
- name: Upload CTK cache
126-
if: ${{ steps.ctk-get-cache.outcome == 'failure' }}
127-
uses: actions/upload-artifact@v4
128-
continue-on-error: true
126+
if: ${{ always() &&
127+
steps.ctk-get-cache.outputs.cache-hit != 'true' }}
128+
uses: actions/cache/save@v4
129129
with:
130130
name: ${{ env.CTK_CACHE_KEY }}
131131
path: ./${{ env.CTK_CACHE_FILENAME }}
132-
if-no-files-found: error
133132

134133
- name: Restore CTK cache
135-
if: ${{ steps.ctk-get-cache.outcome == 'success' }}
134+
if: ${{ steps.ctk-get-cache.outputs.cache-hit == 'true' }}
136135
shell: bash --noprofile --norc -xeuo pipefail {0}
137136
run: |
138137
ls -l

.github/actions/test/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ runs:
5151
5252
- name: Download CTK cache
5353
id: ctk-get-cache
54-
uses: actions/download-artifact@v4
54+
uses: actions/cache/restore@v4
5555
continue-on-error: true
5656
with:
57-
name: ${{ env.CTK_CACHE_KEY }}
58-
path: ./
57+
key: ${{ env.CTK_CACHE_KEY }}
58+
path: ${{ env.CTK_CACHE_FILENAME }}
5959

6060
- name: Restore CTK cache
6161
shell: bash --noprofile --norc -xeuo pipefail {0}

0 commit comments

Comments
 (0)