Skip to content

CI: set up ccache #23

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 9 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading