Skip to content

Commit

Permalink
upload artifacts on cache miss
Browse files Browse the repository at this point in the history
test artifacts with dummy container id
  • Loading branch information
JumiDeluxe committed Nov 13, 2023
1 parent 4977796 commit 4eb22e9
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
container: ghcr.io/kuznia-rdzeni/riscv-toolchain:2023.10.08_v
outputs:
container_id: ${{ job.container.id }}
cache_hit: ${{ steps.cache-regression.outputs.cache-hit }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -31,18 +32,22 @@ jobs:
cache-name: cache-regression-tests
with:
path: test/external/riscv-tests/test-*
key: ${{ env.cache-name }}-${{ runner.os }}-${{
job.container.id }}-${{ hashFiles(
key: ${{ env.cache-name }}-${{ runner.os }}-dummy_id-${{ hashFiles(
'**/test/external/riscv-tests/environment/**',
'**/test/external/riscv-tests/environment/Makefile}'
'**/test/external/riscv-tests/Makefile}'
) }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}-
${{ env.cache-name }}-${{ runner.os }}-dummy_id-
- if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }}
name: Build riscv-tests
run: cd test/external/riscv-tests && make

- if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }}
name: Upload riscv-tests
uses: actions/upload-artifact@v3
with:
path: test/external/riscv-tests

run-regression-tests:
name: Run regression tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -77,10 +82,9 @@ jobs:
cache-name: cache-regression-tests
with:
path: test/external/riscv-tests/test-*
key: ${{ env.cache-name }}-${{ runner.os }}-${{
needs.build-regression-tests.outputs.container_id }}-${{ hashFiles(
key: ${{ env.cache-name }}-${{ runner.os }}-dummy_id-${{ hashFiles(
'**/test/external/riscv-tests/environment/**',
'**/test/external/riscv-tests/environment/Makefile}'
'**/test/external/riscv-tests/Makefile}'
) }}
fail-on-cache-miss: true

Expand Down

0 comments on commit 4eb22e9

Please sign in to comment.