From 7ef9b32faaea94d97715f7e608d4aebed3ec39fb Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Wed, 9 Jun 2021 21:42:08 +0100 Subject: [PATCH] CI: Use separate ccache instances for each job --- .github/workflows/build.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca1b4f3f7..d4581f7eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,6 @@ env: CI_COMMIT: ${{ github.sha }} CCACHE_COMPRESS: 1 CCACHE_DIR: ${{ github.workspace }}/.ccache - CCACHE_MAXSIZE: 2Gi # 2GiB for clang and gcc, 4GiB in total jobs: @@ -31,7 +30,7 @@ jobs: - id: generate name: Run 'generate_matrix.sh' run: | - if [ '${{ github.event_name}}' = 'pull_request' ]; then + if [ '${{ github.event_name }}' = 'pull_request' ]; then matrix='[ "ubuntu-20.04" ]' else matrix='[ "ubuntu-16.04", "ubuntu-18.04", "ubuntu-20.04" ]' @@ -57,7 +56,8 @@ jobs: CI_MAKE_SRC_TARGET: ${{ matrix.debug }} CC: ${{ matrix.compiler.cc }} CXX: ${{ matrix.compiler.cxx }} - CACHE_KEY: ${{ matrix.os }}-${{ matrix.compiler.cc }} + CACHE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.debug }} + CCACHE_MAXSIZE: 256Mi # Per build matrix entry steps: - name: Checkout @@ -77,7 +77,9 @@ jobs: - name: Build run: | + ccache -z ./ci/ci-script.bash + ccache -s tar cvzf verilator-${{ matrix.os}}-${CI_COMMIT}-${{ matrix.compiler.cc }}-${{ matrix.debug }}.tgz ./bin - uses: actions/upload-artifact@v2 @@ -107,7 +109,8 @@ jobs: CI_RUNS_ON: ${{ matrix.os }} CC: ${{ matrix.compiler.cc }} CXX: ${{ matrix.compiler.cxx }} - CACHE_KEY: ${{ matrix.os }}-${{ matrix.compiler.cc }} + CACHE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.suite }} + CCACHE_MAXSIZE: 256Mi # Per build matrix entry steps: - name: Checkout @@ -134,4 +137,7 @@ jobs: - name: Test env: TESTS: ${{ matrix.suite }} - run: ./ci/ci-script.bash + run: | + ccache -z + ./ci/ci-script.bash + ccache -s