Skip to content

Conversation

@nschimme
Copy link
Contributor

@nschimme nschimme commented Dec 22, 2025

Summary by Sourcery

Enable compiler caching in CI builds to speed up repeated compilations across workflows.

Build:

  • Add ccache GitHub Action to AppImage and Wasm build workflows.
  • Configure release and test workflows on Linux and macOS to use ccache with C and C++ compilers via CMake launcher settings.
  • Pass ccache as the C and C++ compiler launcher in CMake invocations for AppImage, Wasm, release, and test builds.

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 22, 2025

Reviewer's Guide

Configures ccache in multiple GitHub Actions workflows and wires it into CMake builds to cache compiler outputs and speed up CI builds on Linux, macOS, AppImage, and Wasm targets.

File-Level Changes

Change Details Files
Introduce ccache setup steps into CI workflows to enable compiler caching.
  • Add a ccache setup step to the AppImage build workflow using hendrikmuhs/ccache-action with symlink creation and a job-based cache key.
  • Add a ccache setup step to the Wasm build workflow using hendrikmuhs/ccache-action with symlink creation and a job-based cache key.
  • Add conditional ccache setup steps to the release build workflow for Linux and macOS runners, using OS-aware cache keys.
  • Add conditional ccache setup steps to the test build workflow for Linux and macOS runners, using OS- and compiler-aware cache keys.
.github/workflows/build-appimage.yml
.github/workflows/build-wasm.yml
.github/workflows/build-release.yml
.github/workflows/build-test.yml
Configure CMake builds to use ccache as the compiler launcher in CI.
  • Set CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER to ccache in the AppImage workflow CMake configuration.
  • Set CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER to ccache in the Wasm workflow CMake configuration.
  • Augment the release workflow CMake configuration to use ccache launchers for C and C++ when generating Ninja builds.
  • Augment the test workflow CMake configuration to use ccache launchers for C and C++ when generating Ninja builds.
.github/workflows/build-appimage.yml
.github/workflows/build-wasm.yml
.github/workflows/build-release.yml
.github/workflows/build-test.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The ccache keys in the AppImage and Wasm workflows are just ${{ github.job }}, which means cache entries won’t vary by branch or significant build inputs; consider including something like ${{ github.ref_name }} or a hash of key CMake files in the key (or restore-keys) to avoid suboptimal or incorrect cache reuse.
  • In build-release.yml and build-test.yml, the CMake *_LAUNCHER=ccache arguments are passed unconditionally even on Windows where ccache is not configured; you may want to guard those flags with the same OS condition as the ccache step or restrict them to non-Windows generators.
  • To make cache invalidation easier in the future, consider adding an explicit cache version segment (e.g., ccache-v1-...) to the key values so you can bump it without changing the rest of the key structure.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The ccache keys in the AppImage and Wasm workflows are just `${{ github.job }}`, which means cache entries won’t vary by branch or significant build inputs; consider including something like `${{ github.ref_name }}` or a hash of key CMake files in the key (or restore-keys) to avoid suboptimal or incorrect cache reuse.
- In `build-release.yml` and `build-test.yml`, the CMake `*_LAUNCHER=ccache` arguments are passed unconditionally even on Windows where ccache is not configured; you may want to guard those flags with the same OS condition as the ccache step or restrict them to non-Windows generators.
- To make cache invalidation easier in the future, consider adding an explicit cache version segment (e.g., `ccache-v1-...`) to the `key` values so you can bump it without changing the rest of the key structure.

## Individual Comments

### Comment 1
<location> `.github/workflows/build-release.yml:93` </location>
<code_context>
         cd build
         cmake --version
-        cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G 'Ninja' -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact $MMAPPER_CMAKE_EXTRA -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -S .. || exit -1
+        cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G 'Ninja' -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact $MMAPPER_CMAKE_EXTRA -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -S .. || exit -1
         cmake --build . --parallel

</code_context>

<issue_to_address>
**issue (bug_risk):** Guard the CMake ccache launcher flags to match the platforms where ccache is configured

These `-DCMAKE_*_COMPILER_LAUNCHER=ccache` flags are always set, but the ccache setup only runs on Linux/macOS. On Windows this will likely reference a non‑existent `ccache` binary and break configuration. Please gate these flags with the same `if: runner.os == 'Linux' || runner.os == 'macOS'` condition (e.g., via an env var or matrix flag) so they’re only applied where ccache is available.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

cd build
cmake --version
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G 'Ninja' -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact $MMAPPER_CMAKE_EXTRA -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -S .. || exit -1
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G 'Ninja' -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact $MMAPPER_CMAKE_EXTRA -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -S .. || exit -1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Guard the CMake ccache launcher flags to match the platforms where ccache is configured

These -DCMAKE_*_COMPILER_LAUNCHER=ccache flags are always set, but the ccache setup only runs on Linux/macOS. On Windows this will likely reference a non‑existent ccache binary and break configuration. Please gate these flags with the same if: runner.os == 'Linux' || runner.os == 'macOS' condition (e.g., via an env var or matrix flag) so they’re only applied where ccache is available.

@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.48%. Comparing base (26d1a9d) to head (82069ac).
⚠️ Report is 158 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #437      +/-   ##
==========================================
- Coverage   66.48%   65.48%   -1.01%     
==========================================
  Files          85       86       +1     
  Lines        4186     3963     -223     
  Branches      255      264       +9     
==========================================
- Hits         2783     2595     -188     
+ Misses       1403     1368      -35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nschimme nschimme merged commit 18b4262 into MUME:master Dec 22, 2025
20 of 21 checks passed
@nschimme nschimme deleted the ccache branch December 22, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant