diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fba21f0da..05265cf5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,21 +56,22 @@ jobs: CI_MAKE_SRC_TARGET: ${{ matrix.debug }} CC: ${{ matrix.compiler.cc }} CXX: ${{ matrix.compiler.cxx }} - CACHE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.debug }} - CCACHE_MAXSIZE: 256Mi # Per build matrix entry + CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.debug }} + CCACHE_MAXSIZE: 128Mi # Per build matrix entry (1Gi in total) steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache + - name: Cache $CCACHE_DIR uses: actions/cache@v2 env: - cache-name: ccache + CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache with: - path: ${{ github.workspace }}/.ccache - key: ${{ env.CACHE_KEY }}-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ env.CACHE_KEY }}-${{ env.cache-name }} + path: ${{ env.CCACHE_DIR }} + key: ${{ env.CACHE_KEY }}-${{ github.sha }} + restore-keys: | + ${{ env.CACHE_KEY }}- - name: Install packages for build run: ./ci/ci-install.bash @@ -109,21 +110,22 @@ jobs: CI_RUNS_ON: ${{ matrix.os }} CC: ${{ matrix.compiler.cc }} CXX: ${{ matrix.compiler.cxx }} - CACHE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.suite }} - CCACHE_MAXSIZE: 256Mi # Per build matrix entry + CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.suite }} + CCACHE_MAXSIZE: 32Mi # Per build matrix entry (960Mi in total) steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache + - name: Cache $CCACHE_DIR uses: actions/cache@v2 env: - cache-name: ccache + CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache with: - path: ${{ github.workspace }}/.ccache - key: ${{ env.CACHE_KEY }}-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ env.CACHE_KEY }}-${{ env.cache-name }} + path: ${{ env.CCACHE_DIR }} + key: ${{ env.CACHE_KEY }}-${{ github.sha }} + restore-keys: | + ${{ env.CACHE_KEY }}- - uses: actions/download-artifact@v2 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 42c0d40cb..6ba5810d7 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -11,8 +11,6 @@ on: env: CI_OS_NAME: linux CI_COMMIT: ${{ github.sha }} - CCACHE_COMPRESS: 1 - CCACHE_DIR: ${{ github.workspace }}/.ccache COVERAGE: 1 jobs: @@ -23,22 +21,11 @@ jobs: env: CI_BUILD_STAGE_NAME: build CI_RUNS_ON: ubuntu-20.04 - CACHE_KEY: coverage-build - CCACHE_MAXSIZE: 512Mi steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache - uses: actions/cache@v2 - env: - cache-name: ccache - with: - path: ${{ github.workspace }}/.ccache - key: ${{ env.CACHE_KEY }}-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ env.CACHE_KEY }}-${{ env.cache-name }} - - name: Install packages for build env: CI_BUILD_STAGE_NAME: build @@ -46,9 +33,7 @@ jobs: - name: Build run: | - ccache -z ./ci/ci-script.bash - ccache -s tar cvzf verilator-${CI_COMMIT}-coverage.tgz bin src/obj*/*.o src/obj*/*.gcno - uses: actions/upload-artifact@v2 @@ -82,22 +67,11 @@ jobs: env: CI_BUILD_STAGE_NAME: test CI_RUNS_ON: ubuntu-20.04 - CACHE_KEY: coverage-test-${{ matrix.test }}${{ matrix.num }} - CCACHE_MAXSIZE: 512Mi # Per build matrix entry steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache - uses: actions/cache@v2 - env: - cache-name: ccache - with: - path: ${{ github.workspace }}/.ccache - key: ${{ env.CACHE_KEY }}-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ env.CACHE_KEY }}-${{ env.cache-name }} - - uses: actions/download-artifact@v2 - name: Install Verilator and test dependencies @@ -110,6 +84,4 @@ jobs: env: TESTS: coverage-${{ matrix.test }}${{ matrix.num }} run: | - ccache -z ./ci/ci-script.bash - ccache -s