From 950bb8b33f7b1c742e5a293683cc5d1b0a9ba671 Mon Sep 17 00:00:00 2001 From: Yury Frolov <57130330+EinKrebs@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:11:41 +0500 Subject: [PATCH] Fix cache errors in feature tests (#622) * Debug output * Change cache key to commit hash --- .github/workflows/tests.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ccd7b5fb7..2f8c022cb 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -82,11 +82,13 @@ jobs: - name: Check out code uses: actions/checkout@v4 + - id: step1 run: | make split_feature_test array=$(find test/feature/generatedFeatures -type f -exec wc -l {} \; | sort -rn | awk '{printf $0"\n"}' | python3 .github/scenario_balancer.py) echo "features=$(echo "{\"command\": $array}")" >> $GITHUB_OUTPUT + - name: Archive production artifacts uses: actions/upload-artifact@v4 with: @@ -96,7 +98,7 @@ jobs: - name: Update env run: | - SHARD_CACHE_KEY="spqr-shard-image-$(find docker/shard/ -type f -exec sha256sum '{}' \; | sha256sum | awk '{printf $1}')" + SHARD_CACHE_KEY="spqr-shard-image-$(git rev-parse HEAD)" CACHE_FILE_SHARD="~/$SHARD_CACHE_KEY.tgz" echo "SHARD_CACHE_KEY=$SHARD_CACHE_KEY" >> $GITHUB_ENV echo "CACHE_FILE_SHARD=$CACHE_FILE_SHARD" >> $GITHUB_ENV @@ -139,7 +141,7 @@ jobs: - name: Update env run: | - SHARD_CACHE_KEY="spqr-shard-image-$(find docker/shard/ -type f -exec sha256sum '{}' \; | sha256sum | awk '{printf $1}')" + SHARD_CACHE_KEY="spqr-shard-image-$(git rev-parse HEAD)" CACHE_FILE_SHARD="~/$SHARD_CACHE_KEY.tgz" echo "SHARD_CACHE_KEY=$SHARD_CACHE_KEY" >> $GITHUB_ENV echo "CACHE_FILE_SHARD=$CACHE_FILE_SHARD" >> $GITHUB_ENV