From 2d2bd5b95e3a086949e22efe0e1d302dbb8581d8 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sun, 13 Jun 2021 01:05:42 +0100 Subject: [PATCH] CI: Upload separate named artifacts, only fetch ones that are needed --- .github/workflows/build.yml | 30 ++++++++++++++++++++++-------- .github/workflows/coverage.yml | 23 ++++++++++++++++------- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05265cf5d..f9d9ef934 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,6 +58,7 @@ jobs: CXX: ${{ matrix.compiler.cxx }} CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.debug }} CCACHE_MAXSIZE: 128Mi # Per build matrix entry (1Gi in total) + VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.debug }}.tar.gz steps: - name: Checkout @@ -81,11 +82,13 @@ jobs: ccache -z ./ci/ci-script.bash ccache -s - tar cvzf verilator-${{ matrix.os}}-${CI_COMMIT}-${{ matrix.compiler.cc }}-${{ matrix.debug }}.tgz ./bin + tar cvzf ${{ env.VERILATOR_ARCHIVE }} bin - - uses: actions/upload-artifact@v2 + - name: Upload Verilator artifact + uses: actions/upload-artifact@v2 with: - path: verilator-${{ matrix.os}}-${{ env.CI_COMMIT }}-${{ matrix.compiler.cc }}-${{ matrix.debug }}.tgz + name: ${{ env.VERILATOR_ARCHIVE }} + path: ${{ env.VERILATOR_ARCHIVE }} Test: @@ -112,6 +115,7 @@ jobs: CXX: ${{ matrix.compiler.cxx }} CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.suite }} CCACHE_MAXSIZE: 32Mi # Per build matrix entry (960Mi in total) + VERILATOR_ARCHIVE_BASE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }} steps: - name: Checkout @@ -127,13 +131,23 @@ jobs: restore-keys: | ${{ env.CACHE_KEY }}- - - uses: actions/download-artifact@v2 + - name: Download Verilator artifact (opt) + uses: actions/download-artifact@v2 + with: + name: ${{ env.VERILATOR_ARCHIVE_BASE }}-opt.tar.gz - - name: Install Verilator and test dependencies + - name: Download Verilator artifact (dbg) + uses: actions/download-artifact@v2 + with: + name: ${{ env.VERILATOR_ARCHIVE_BASE }}-dbg.tar.gz + + - name: Unpack Verilator artifacts + run: | + tar xvzf ${{ env.VERILATOR_ARCHIVE_BASE }}-opt.tar.gz + tar xvzf ${{ env.VERILATOR_ARCHIVE_BASE }}-dbg.tar.gz + + - name: Install test dependencies run: | - tar xvzf artifact/verilator-${{ matrix.os}}-${CI_COMMIT}-${{ matrix.compiler.cc }}-opt.tgz - tar xvzf artifact/verilator-${{ matrix.os}}-${CI_COMMIT}-${{ matrix.compiler.cc }}-dbg.tgz - rm -rf artifact ./ci/ci-install.bash - name: Test diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6ba5810d7..fb6dcd862 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,6 +12,7 @@ env: CI_OS_NAME: linux CI_COMMIT: ${{ github.sha }} COVERAGE: 1 + VERILATOR_ARCHIVE: verilator-coverage-${{ github.sha }}.tar.gz jobs: @@ -34,11 +35,13 @@ jobs: - name: Build run: | ./ci/ci-script.bash - tar cvzf verilator-${CI_COMMIT}-coverage.tgz bin src/obj*/*.o src/obj*/*.gcno + tar cvzf ${{ env.VERILATOR_ARCHIVE }} bin src/obj*/*.o src/obj*/*.gcno - - uses: actions/upload-artifact@v2 - with: - path: verilator-${{ env.CI_COMMIT }}-coverage.tgz + - name: Upload Verilator artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.VERILATOR_ARCHIVE }} + path: ${{ env.VERILATOR_ARCHIVE }} Test: @@ -72,12 +75,18 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 + - name: Download Verilator artifact + uses: actions/download-artifact@v2 + with: + name: ${{ env.VERILATOR_ARCHIVE }} - - name: Install Verilator and test dependencies + - name: Unapack Verilator artifact run: | - tar xvzf artifact/verilator-${CI_COMMIT}-coverage.tgz + tar xvzf ${{ env.VERILATOR_ARCHIVE }} touch src/obj*/*.o src/obj*/*.gcno + + - name: Install test dependencies + run: | ./ci/ci-install.bash - name: Test