Skip to content

Commit

Permalink
Merge pull request #26 from pd-rs/cach-key-hash-url
Browse files Browse the repository at this point in the history
Better way to make key for cache-key - hash by url
  • Loading branch information
boozook authored Oct 1, 2023
2 parents 402b435 + 41c7578 commit 843d390
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run:
shell: bash
strategy:
fail-fast: true
fail-fast: false
matrix:
os:
- macos-latest
Expand Down
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,22 @@ runs:
DIRECT_URL=$(trim "$DIRECT_URL")
echo "direct url: $DIRECT_URL"
echo "url=$DIRECT_URL" >> $GITHUB_OUTPUT
echo "$DIRECT_URL" > ./TEMP_SDK_INSTALLER_URL
- name: hash url
id: hash
shell: bash
run: |
echo "url=${{ hashFiles('./TEMP_SDK_INSTALLER_URL') }}" >> $GITHUB_OUTPUT
echo "hash: ${{ hashFiles('./TEMP_SDK_INSTALLER_URL') }}"
rm ./TEMP_SDK_INSTALLER_URL
- name: Cache restore
if: inputs.cache == 'true'
uses: actions/cache/restore@v3
id: cache-restore
with:
path: ${{ steps.cfg.outputs.filename }}
key: ${{ runner.os }}-${{ steps.direct-url.outputs.url }}
key: ${{ runner.os }}-pd-sdk-${{ steps.hash.outputs.url }}

- name: download
# not using cache or have got cache-miss
Expand Down

0 comments on commit 843d390

Please sign in to comment.