Skip to content

Commit

Permalink
switch to use github cache to improve reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed Dec 8, 2024
1 parent 8a6738b commit ed0386a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
19 changes: 9 additions & 10 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ runs:
- name: Download CTK cache
id: ctk-get-cache
uses: actions/download-artifact@v4
uses: actions/cache/restore@v4
continue-on-error: true
with:
name: ${{ env.CTK_CACHE_KEY }}
path: ./
key: ${{ env.CTK_CACHE_KEY }}
path: ./${{ env.CTK_CACHE_FILENAME }}

- name: Get CUDA components
if: ${{ steps.ctk-get-cache.outcome == 'failure' }}
if: ${{ steps.ctk-get-cache.outputs.cache-hit != 'true' }}
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
CUDA_PATH="./cuda_toolkit"
Expand Down Expand Up @@ -123,16 +123,15 @@ runs:
# so setting the CUDA_PATH env var here is meaningless.
- name: Upload CTK cache
if: ${{ steps.ctk-get-cache.outcome == 'failure' }}
uses: actions/upload-artifact@v4
continue-on-error: true
if: ${{ always() &&
steps.ctk-get-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
name: ${{ env.CTK_CACHE_KEY }}
key: ${{ env.CTK_CACHE_KEY }}
path: ./${{ env.CTK_CACHE_FILENAME }}
if-no-files-found: error

- name: Restore CTK cache
if: ${{ steps.ctk-get-cache.outcome == 'success' }}
if: ${{ steps.ctk-get-cache.outputs.cache-hit == 'true' }}
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
ls -l
Expand Down
7 changes: 4 additions & 3 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ runs:
- name: Download CTK cache
id: ctk-get-cache
uses: actions/download-artifact@v4
uses: actions/cache/restore@v4
continue-on-error: true
with:
name: ${{ env.CTK_CACHE_KEY }}
path: ./
key: ${{ env.CTK_CACHE_KEY }}
path: ./${{ env.CTK_CACHE_FILENAME }}
fail-on-cache-miss: true

- name: Restore CTK cache
shell: bash --noprofile --norc -xeuo pipefail {0}
Expand Down

0 comments on commit ed0386a

Please sign in to comment.