diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38690c4fa..3d619e1f1 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=$(echo 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,11 +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}' - ) }} + ) }}-${{ env.RISCV_COMMIT }} restore-keys: | ${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}- @@ -61,6 +66,10 @@ jobs: with: submodules: recursive + - name: Get riscv-tests submodule commit id + run: | + echo "RISCV_COMMIT=$(echo git ls-remote https://github.com/riscv-software-src/riscv-tests.git HEAD | awk '{ print $1 }')" >> $GITHUB_ENV + - name: Set up Python uses: actions/setup-python@v4 with: @@ -83,11 +92,12 @@ jobs: cache-name: cache-regression-tests with: path: test/external/riscv-tests/test-* + run: | + echo "RISCV_COMMIT=$(echo git ls-remote https://github.com/riscv-software-src/riscv-tests.git HEAD | awk '{ print $1 }')" >> $GITHUB_ENV 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}') }}-${{ env.RISCV_COMMIT }} fail-on-cache-miss: true - name: Run tests