From b9eeb9f9f00074a15ab63d862491f861918c6f2b Mon Sep 17 00:00:00 2001 From: Pawel Czarnecki Date: Fri, 7 Jul 2023 10:44:31 +0200 Subject: [PATCH] CI: physical design flow: fixup cache Signed-off-by: Pawel Czarnecki --- .github/workflows/build-yosys-systemverilog.yml | 7 ++++--- .github/workflows/run-physical-design-flow.yml | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-yosys-systemverilog.yml b/.github/workflows/build-yosys-systemverilog.yml index 8b10ea3e1c9..e59d2b421ba 100644 --- a/.github/workflows/build-yosys-systemverilog.yml +++ b/.github/workflows/build-yosys-systemverilog.yml @@ -17,10 +17,12 @@ jobs: run: | cache_date=$(date +"%Y_%m_%d") cache_name=cache_${{ env.TOOL_NAME }} + git_hash=$(git submodule status third_party/yosys-systemverilog | awk '{print $1}') echo "Cache date: "$cache_date echo "Cache name: "$cache_name - echo "cache_date=$cache_date" >> "$GITHUB_ENV" + echo "Yosys-systemverilog submodule git hash: "$git_hash echo "cache_name=$cache_name" >> "$GITHUB_ENV" + echo "git_hash=$git_hash" >> "$GITHUB_ENV" - name: Setup cache uses: actions/cache@v3 @@ -29,8 +31,7 @@ jobs: with: path: | /opt/yosys-systemverilog - key: ${{ env.cache_name }}_${{ env.cache_date }} - restore-keys: ${{ env.cache_name }} + key: ${{ env.cache_name }}_${{ env.git_hash }} - name: Setup repository if: ${{ steps.cache.outputs.cache-hit != 'true' }} diff --git a/.github/workflows/run-physical-design-flow.yml b/.github/workflows/run-physical-design-flow.yml index c9e49a97052..94261632f2b 100644 --- a/.github/workflows/run-physical-design-flow.yml +++ b/.github/workflows/run-physical-design-flow.yml @@ -23,8 +23,9 @@ jobs: run: | date=$(date +"%Y_%m_%d") time=$(date +"%Y%m%d_%H%M%S_%N") - cache_yosys_systemverilog_restore_key=cache_yosys_systemverilog - cache_yosys_systemverilog_key=${cache_yosys_systemverilog_restore_key} + cache_yosys_systemverilog_git_hash=$(git submodule status third_party/yosys-systemverilog | awk '{print $1}') + cache_yosys_systemverilog_restore_key=cache_yosys_systemverilog_ + cache_yosys_systemverilog_key=${cache_yosys_systemverilog_restore_key}_${cache_yosys_systemverilog_git_hash} echo "date=$date" | tee -a "$GITHUB_ENV" echo "time=$time" | tee -a "$GITHUB_ENV"