Skip to content

Commit

Permalink
Cache riscv-arch-test build (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotro888 authored Mar 10, 2024
1 parent dbdec14 commit 09e3e73
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 11 deletions.
65 changes: 54 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,35 +57,63 @@ jobs:
defaults:
run:
working-directory: test/external/riscof/

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Cache compiled and reference riscv-arch-test
id: cache-riscv-arch-test
uses: actions/cache@v3
env:
cache-name: cache-riscv-arch-test
with:
path: |
test/external/riscof/riscv-arch-test/**/*.elf
test/external/riscof/riscof_work/**/*.signature
test/external/riscof/**/*Makefile*
- name: Setup PATH
key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
'**/test/external/riscof/coreblocks/**',
'**/test/external/riscof/spike_simple/**',
'**/test/external/riscof/config.ini',
'**/.git/modules/test/external/riscof/riscv-arch-test/HEAD',
'**/docker/riscv-toolchain.Dockerfile'
) }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Setup PATH
run: echo "/.pyenv/bin" >> $GITHUB_PATH

- name: Setup pyenv python
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Setup pyenv python
run: |
eval "$(pyenv init --path)"
pyenv global 3.6.15
. /venv3.6/bin/activate
- name: Setup arch test suite
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Setup arch test suite
run: |
. /venv3.6/bin/activate
riscof --verbose info arch-test --clone
riscof testlist --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env
- name: Build and run tests on reference and generate Makefiles
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Build and run tests on reference and generate Makefiles
run: |
. /venv3.6/bin/activate
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env
- name: Build tests for Coreblocks
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Build tests for Coreblocks
run: |
MAKEFILE_PATH=riscof_work/Makefile.build-DUT-coreblocks ../../../ci/riscof_run_makefile.sh
- uses: actions/upload-artifact@v3
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
uses: actions/upload-artifact@v3
with:
name: "riscof-tests"
path: |
Expand All @@ -102,6 +130,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -120,10 +150,23 @@ jobs:
name: "verilog-full-core"
path: .

- uses: actions/download-artifact@v3
- uses: actions/cache@v3
env:
cache-name: cache-riscv-arch-test
with:
name: "riscof-tests"
path: test/external/riscof/
path: |
test/external/riscof/riscv-arch-test/**/*.elf
test/external/riscof/riscof_work/**/*.signature
test/external/riscof/**/*Makefile*
key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
'**/test/external/riscof/coreblocks/**',
'**/test/external/riscof/spike_simple/**',
'**/test/external/riscof/config.ini',
'**/.git/modules/test/external/riscof/riscv-arch-test/HEAD',
'**/docker/riscv-toolchain.Dockerfile'
) }}
fail-on-cache-miss: true

- name: Run tests on Coreblocks
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
path = test/external/embench/embench-iot
url = https://github.com/embench/embench-iot.git
ignore = dirty
[submodule "test/external/riscof/riscv-arch-test"]
path = test/external/riscof/riscv-arch-test
url = https://github.com/riscv-non-isa/riscv-arch-test.git
1 change: 1 addition & 0 deletions test/external/riscof/riscv-arch-test
Submodule riscv-arch-test added at 8a52b0

0 comments on commit 09e3e73

Please sign in to comment.