Skip to content

Commit

Permalink
Use cache instead of artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioOpenHWGroup committed Feb 27, 2024
1 parent bfd6775 commit 21d7e19
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,22 @@ jobs:
- name: Prepare
run: |
ci/setup.sh
tar cfz tools.tar.gz tools/
du -sh tools.tar.gz
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: compiled-tools
path: |
tools.tar.gz
- name: Cache tools
id: cache-tools
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: tools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/core-v-verif/vendor/riscv/',
'verif/regress/install-verilator.sh', 'verif/regress/install-spike.sh', 'ci/') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-


execute-riscv-tests:
name: execute-riscv-tests
Expand All @@ -44,10 +51,24 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: compiled-tools
- name: Cache tools
id: cache-tools
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: tools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/core-v-verif/vendor/riscv/',
'verif/regress/install-verilator.sh', 'verif/regress/install-spike.sh', 'ci/') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-

- if: ${{ steps.cache-tools.outputs.cache-hit != 'true' }}
name: List the versions of the tool
continue-on-error: true
run: ./tools/spike/bin/spike -v || ./tools/bin/verilator -v
- name: Run Tests
run: |
set -x
Expand Down

0 comments on commit 21d7e19

Please sign in to comment.