diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86cb1afdbd0..3ff7f658101 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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