Skip to content

Commit 778395a

Browse files
authored
Merge pull request #23 from lucascolley/ccache
CI: set up ccache
2 parents 898f556 + 934929a commit 778395a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ jobs:
2929
pixi-version: v0.45.0
3030
cache: true
3131
environments: ${{ matrix.environment }}
32+
- name: Prepare compiler cache
33+
id: prep-ccache
34+
shell: bash
35+
run: |
36+
mkdir -p "${CCACHE_DIR}"
37+
echo "dir=$CCACHE_DIR" >> $GITHUB_OUTPUT
38+
NOW=$(date -u +"%F-%T")
39+
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT
40+
- name: Setup compiler cache
41+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
42+
id: cache-ccache
43+
with:
44+
path: ${{ steps.prep-ccache.outputs.dir }}
45+
key: ${{ github.workflow }}-ccache-${{ matrix.environment }}-${{ matrix.runs-on }}-${{ steps.prep-ccache.outputs.timestamp }}
46+
restore-keys: ${{ github.workflow }}-ccache-${{ matrix.environment }}-${{ matrix.runs-on }}-
3247
- name: Build xsf
3348
run: pixi run --environment=tests-ci build-tests-ci
3449
- name: Run tests
@@ -40,3 +55,6 @@ jobs:
4055
with:
4156
name: cov-html-${{ matrix.runs-on }}
4257
path: build/coverage_report/**
58+
- name: Ccache performance
59+
shell: bash -l {0}
60+
run: pixi run --environment=tests-ci ccache -s

pixi.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ configure-coverage.cmd = [
8585
]
8686
configure-coverage.cwd = "."
8787
configure-coverage.env.XSREF_TABLES_PATH = "$PWD/xsref/tables"
88+
configure-coverage.env.CC = "ccache $CC"
89+
configure-coverage.env.CXX = "ccache $CXX"
8890
# Open coverage report
8991
open-coverage.cmd = ["open", "index.html"]
9092
open-coverage.cwd = "build/coverage_report"

0 commit comments

Comments
 (0)