Skip to content
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
19 changes: 19 additions & 0 deletions .github/actions/cmake-project-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ runs:
# TODO: Install cmake through mise
uses: lukka/get-cmake@9e07ecdcee1b12e5037e42f410b67f03e2f626e1 # v4.2.1

- name: Determine sccache version
id: sccache-version
run: |
pushd solvers/cpp
sccache_version=$(mise tool sccache --active | tr -d '\n')
echo "version=v${sccache_version}" | tee -a "${GITHUB_OUTPUT}"
shell: bash

- name: Setup sccache
# TODO: Use sccache from mise when it's possible to avoid installing it via this action
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
with:
version: ${{ steps.sccache-version.outputs.version }}

- name: Enable sccache for C++
run: |
echo "SCCACHE_GHA_ENABLED=true" | tee -a "${GITHUB_ENV}"
shell: bash

- name: Prepare files
run: |
cp .github/files/CMakeUserPresets.json solvers/cpp/
Expand Down
33 changes: 27 additions & 6 deletions .github/files/CMakeUserPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,52 @@
"configurePresets": [
{
"name": "ci-macos-clang-libc++-debug",
"inherits": ["_ci-macos-clang-libc++", "_ci-debug", "_ci-clang-tidy"]
"inherits": [
"sccache",
"_ci-macos-clang-libc++",
"_ci-debug",
"_ci-clang-tidy"
]
},
{
"name": "ci-macos-clang-libc++-release",
"inherits": ["_ci-macos-clang-libc++", "_ci-release", "_ci-clang-tidy"]
"inherits": [
"sccache",
"_ci-macos-clang-libc++",
"_ci-release",
"_ci-clang-tidy"
]
},
{
"name": "ci-macos-clang-libstdc++-debug",
"inherits": ["_ci-macos-clang-libstdc++", "_ci-debug", "_ci-clang-tidy"]
"inherits": [
"sccache",
"_ci-macos-clang-libstdc++",
"_ci-debug",
"_ci-clang-tidy"
]
},
{
"name": "ci-macos-clang-libstdc++-release",
"inherits": ["_ci-macos-clang-libstdc++", "_ci-release", "_ci-clang-tidy"]
"inherits": [
"sccache",
"_ci-macos-clang-libstdc++",
"_ci-release",
"_ci-clang-tidy"
]
},
{
"name": "ci-macos-gcc-libstdc++-debug",
"inherits": ["_ci-macos-gcc", "_ci-debug"]
"inherits": ["sccache", "_ci-macos-gcc", "_ci-debug"]
},
{
"name": "ci-macos-gcc-libstdc++-release",
"inherits": ["_ci-macos-gcc", "_ci-release"]
"inherits": ["sccache", "_ci-macos-gcc", "_ci-release"]
},
{
"name": "ci-ubuntu-clang-libstdc++-release",
"inherits": [
"sccache",
"_ci-ubuntu-clang-libstdc++",
"_ci-release",
"_ci-clang-tidy"
Expand Down
7 changes: 7 additions & 0 deletions solvers/cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
"cacheVariables": {
"CMAKE_CXX_FLAGS": "$env{PRESET_CXX_FLAGS_GCC_CLANG}"
}
},
{
"name": "sccache",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
}
}
],
"testPresets": [
Expand Down
1 change: 1 addition & 0 deletions solvers/cpp/mise.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tools]
"pipx:clang-format" = "21.1.8"
conan = "2.24.0"
sccache = "0.12.0"

[tasks.check]
depends = [
Expand Down
Loading