feat(ci): Add ccache support for faster builds#882
Conversation
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
|
still very time-consuming |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #882 +/- ##
============================================
- Coverage 79.84% 76.77% -3.07%
Complexity 615 615
============================================
Files 93 84 -9
Lines 10310 8897 -1413
Branches 1055 1055
============================================
- Hits 8232 6831 -1401
+ Misses 1838 1826 -12
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: syaojun <libevent@yeah.net>
.github/workflows/ci-nightly.yml
Outdated
| with: | ||
| path: ~/.ccache | ||
| key: ${{ matrix.os }}-build-ccache-${{ hashFiles('**/git-modules.txt') }} | ||
| key: ${{ runner.os }}-nightly-ccache-${{ github.sha }} |
There was a problem hiding this comment.
Why should it be changed to runner?
There was a problem hiding this comment.
The matrix.os variable is not configured in the CI pipeline. If the pipeline needs to utilize matrix.os, this variable must first be explicitly defined in the configuration as follows:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]Therefore, the runner.os variable should be used instead in the current setup.
There was a problem hiding this comment.
Pull request overview
This PR adds ccache support to speed up C++ compilation in CI workflows, particularly targeting the slow macOS C++ CI pipeline that was taking over 1.5 hours. The implementation adds a configurable ccache option to CMakeLists.txt and integrates ccache caching into GitHub Actions workflows for Ubuntu, macOS, and nightly builds.
Changes:
- Added
GRAPHAR_ENABLE_CCACHECMake option (defaulting to ON) with graceful fallback when ccache is not available - Integrated ccache caching in GitHub Actions workflows for Ubuntu and macOS CI jobs
- Updated nightly CI workflow to use actions/cache@v4 with improved cache configuration
- Restructured benchmark linking logic for macOS to be more maintainable
- Added linker optimizations and SystemConfiguration framework for macOS benchmarks
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| cpp/CMakeLists.txt | Added GRAPHAR_ENABLE_CCACHE option with detection logic; restructured macOS benchmark linking; added linker optimizations for faster macOS linking |
| .github/workflows/ci.yml | Added ccache caching steps for both Ubuntu and macOS CI jobs |
| .github/workflows/ci-nightly.yml | Updated to use actions/cache@v4 and improved cache key naming |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
Signed-off-by: syaojun <libevent@yeah.net>
|
For Simplicity, this PR mainly resolved ccahe configuration in CI. |
fix: #879