From 754181720483e1d9de02b4fa58cb16a7798c4367 Mon Sep 17 00:00:00 2001 From: Marie Backman Date: Tue, 10 Dec 2024 14:41:51 -0500 Subject: [PATCH] use the submodule commit as the test data cache key (#113) --- .github/workflows/actions.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 9002225..55a5e50 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -29,12 +29,19 @@ jobs: mamba-version: "*" environment-file: environment.yml + - name: Generate cache key for submodule + id: generate-cache-key + run: | + # Get the submodule commit SHA + SUBMODULE_SHA=$(git submodule status | awk '{print $1}' | sha256sum | cut -d ' ' -f 1) + echo "SUBMODULE_KEY=$SUBMODULE_SHA" >> $GITHUB_ENV + - name: Restore/save LFS files in cache id: cache-lfs uses: actions/cache@v4 with: path: test/data/reflectivity_ui-data/ - key: ${{ runner.os }}-lfs-files + key: submodule-${{ env.SUBMODULE_KEY }} - name: Pull LFS files for the submodule if: steps.cache-lfs.outputs.cache-hit != 'true'