diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 21b76dde1d..11e7b6c8e5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,6 +29,21 @@ jobs: pixi-version: v0.45.0 cache: true environments: ${{ matrix.environment }} + - name: Prepare compiler cache + id: prep-ccache + shell: bash + run: | + mkdir -p "${CCACHE_DIR}" + echo "dir=$CCACHE_DIR" >> $GITHUB_OUTPUT + NOW=$(date -u +"%F-%T") + echo "timestamp=${NOW}" >> $GITHUB_OUTPUT + - name: Setup compiler cache + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + id: cache-ccache + with: + path: ${{ steps.prep-ccache.outputs.dir }} + key: ${{ github.workflow }}-ccache-${{ matrix.environment }}-${{ matrix.runs-on }}-${{ steps.prep-ccache.outputs.timestamp }} + restore-keys: ${{ github.workflow }}-ccache-${{ matrix.environment }}-${{ matrix.runs-on }}- - name: Build xsf run: pixi run --environment=tests-ci build-tests-ci - name: Run tests @@ -40,3 +55,6 @@ jobs: with: name: cov-html-${{ matrix.runs-on }} path: build/coverage_report/** + - name: Ccache performance + shell: bash -l {0} + run: pixi run --environment=tests-ci ccache -s diff --git a/pixi.toml b/pixi.toml index e547d83451..6ec597795e 100644 --- a/pixi.toml +++ b/pixi.toml @@ -85,6 +85,8 @@ configure-coverage.cmd = [ ] configure-coverage.cwd = "." configure-coverage.env.XSREF_TABLES_PATH = "$PWD/xsref/tables" +configure-coverage.env.CC = "ccache $CC" +configure-coverage.env.CXX = "ccache $CXX" # Open coverage report open-coverage.cmd = ["open", "index.html"] open-coverage.cwd = "build/coverage_report"