diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38690c4fa..c40ed484a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,6 +24,10 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + + - name: Get riscv-tests submodule commit id + run: | + echo "RISCV_COMMIT=$(git ls-remote https://github.com/riscv-software-src/riscv-tests.git HEAD | awk '{ print $1 }')" >> $GITHUB_ENV - name: Cache regression-tests id: cache-regression @@ -32,10 +36,12 @@ jobs: cache-name: cache-regression-tests with: path: test/external/riscv-tests/test-* + key: ${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}-${{ hashFiles( '**/test/external/riscv-tests/environment/**', - '**/test/external/riscv-tests/Makefile}' + '**/test/external/riscv-tests/Makefile', + '.git/modules/test/external/riscv-tests/riscv-tests/HEAD' ) }} restore-keys: | ${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}- @@ -86,8 +92,9 @@ jobs: key: ${{ env.cache-name }}-${{ runner.os }}-${{ needs.build-regression-tests.outputs.container_id }}-${{ hashFiles( '**/test/external/riscv-tests/environment/**', - '**/test/external/riscv-tests/Makefile}' - ) }} + '**/test/external/riscv-tests/Makefile', + '.git/modules/test/external/riscv-tests/riscv-tests/HEAD' + ) }} fail-on-cache-miss: true - name: Run tests