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 00a63ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 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 }}
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
6 changes: 3 additions & 3 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ 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: Restore CTK cache
shell: bash --noprofile --norc -xeuo pipefail {0}
Expand Down

0 comments on commit 00a63ca

Please sign in to comment.