Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache regression tests in workflow #495

Merged
merged 11 commits into from
Nov 14, 2023
37 changes: 27 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,29 @@ jobs:
name: Build regression tests
runs-on: ubuntu-latest
container: ghcr.io/kuznia-rdzeni/riscv-toolchain:2023.10.08_v
outputs:
container_id: ${{ job.container.id }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Build riscv-tests
run: cd test/external/riscv-tests && make

- uses: actions/upload-artifact@v3
- name: Cache regression-tests
id: cache-regression
uses: actions/cache@v3
env:
cache-name: cache-regression-tests
with:
name: "riscv-tests"
path: |
test/external/riscv-tests/test-*
path: test/external/riscv-tests/test-*
key: ${{ env.cache-name }}-${{ runner.os }}-${{
job.container.id }}-${{ hashFiles('**/test/external/riscv-tests') }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}-

- if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }}
name: Build riscv-tests
run: cd test/external/riscv-tests && make

run-regression-tests:
name: Run regression tests
Expand All @@ -40,6 +49,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -58,10 +69,16 @@ jobs:
. venv/bin/activate
PYTHONHASHSEED=0 ./scripts/gen_verilog.py --verbose --config full

- uses: actions/download-artifact@v3
- uses: actions/cache@v3
env:
cache-name: cache-regression-tests
with:
name: "riscv-tests"
path: test/external/riscv-tests
submodules: recursive
JumiDeluxe marked this conversation as resolved.
Show resolved Hide resolved
path: test/external/riscv-tests/test-*
key: ${{ env.cache-name }}-${{ runner.os }}-${{
needs.build-regression-tests.outputs.container_id }}-${{ hashFiles('**/test/external/riscv-tests') }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ needs.build-regression-tests.outputs.container_id }}-
JumiDeluxe marked this conversation as resolved.
Show resolved Hide resolved

- name: Run tests
run: |
Expand Down
Loading