From a24d3bfbbda84bd0a95d9a6f2f9c9809013afbe4 Mon Sep 17 00:00:00 2001 From: JumiDeluxe Date: Mon, 30 Oct 2023 12:41:31 +0100 Subject: [PATCH 1/3] Cache regression tests in workflow --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 957e2b1c5..629f4c0cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,14 +22,23 @@ jobs: 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: ${{ runner.os }}-build-${{ env.cache-name }}-${{ + hashFiles('**/riscv-tests/test-*') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - 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 @@ -58,10 +67,17 @@ 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 + path: test/external/riscv-tests/test-* + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ + hashFiles('**/riscv-tests/test-*') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - name: Run tests run: | From 80613679ee1f633fc42e2dfd92d3bef4f58df8f3 Mon Sep 17 00:00:00 2001 From: JumiDeluxe Date: Mon, 30 Oct 2023 19:06:09 +0100 Subject: [PATCH 2/3] Regression test cache name change and strictier restore keys --- .github/workflows/main.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 629f4c0cc..4f5fa38ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,12 +29,11 @@ jobs: cache-name: cache-regression-tests with: path: test/external/riscv-tests/test-* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ - hashFiles('**/riscv-tests/test-*') }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ + job.container.id }}-${{ hashFiles('**/test/external/riscv-tests') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}- + ${{ env.cache-name }}-${{ runner.os }}- - if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }} name: Build riscv-tests @@ -49,6 +48,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + submodules: recursive - name: Set up Python uses: actions/setup-python@v4 @@ -71,13 +72,13 @@ jobs: env: cache-name: cache-regression-tests with: + submodules: recursive path: test/external/riscv-tests/test-* - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ - hashFiles('**/riscv-tests/test-*') }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ + job.container.id }}-${{ hashFiles('**/test/external/riscv-tests') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}- + ${{ env.cache-name }}-${{ runner.os }}- - name: Run tests run: | From 44a50f941d69ce925ab0b2540623ab0e5c00fce5 Mon Sep 17 00:00:00 2001 From: Lekcyjna <309016@uwr.edu.pl> Date: Thu, 2 Nov 2023 18:21:34 +0100 Subject: [PATCH 3/3] Add need dependency. --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f5fa38ba..833043265 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,8 @@ 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 @@ -33,7 +35,6 @@ jobs: job.container.id }}-${{ hashFiles('**/test/external/riscv-tests') }} restore-keys: | ${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}- - ${{ env.cache-name }}-${{ runner.os }}- - if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }} name: Build riscv-tests @@ -75,10 +76,9 @@ jobs: submodules: recursive path: test/external/riscv-tests/test-* key: ${{ env.cache-name }}-${{ runner.os }}-${{ - job.container.id }}-${{ hashFiles('**/test/external/riscv-tests') }} + needs.build-regression-tests.outputs.container_id }}-${{ hashFiles('**/test/external/riscv-tests') }} restore-keys: | - ${{ env.cache-name }}-${{ runner.os }}-${{ job.container.id }}- - ${{ env.cache-name }}-${{ runner.os }}- + ${{ env.cache-name }}-${{ runner.os }}-${{ needs.build-regression-tests.outputs.container_id }}- - name: Run tests run: |