mirror of
https://github.com/verilator/verilator.git
synced 2026-09-02 02:38:15 +02:00
CI: Improve caching
GitHub Actions allow a total 5 GB of cache storage space per repository, after which it will evict old caches. Tweaked cache sizes so master + a few PRs can fit at the same time. Don't cache coverage builds as they run weekly and with additional compiler options, so their caches would likely be state anyway.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user