From 41c75789104628a6864c1b67d36687f00082f9c5 Mon Sep 17 00:00:00 2001 From: Alexander Koz Date: Sun, 1 Oct 2023 12:40:24 +0400 Subject: [PATCH] proper way to make key for cache-key - hash by url --- .github/workflows/tests.yml | 2 +- action.yml | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3a6ffc0..bc73456 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: run: shell: bash strategy: - fail-fast: true + fail-fast: false matrix: os: - macos-latest diff --git a/action.yml b/action.yml index 7490850..e229aa1 100644 --- a/action.yml +++ b/action.yml @@ -60,6 +60,14 @@ 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' @@ -67,7 +75,7 @@ runs: 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