Skip to content

Commit bd9e518

Browse files
use ccache on linux CI
1 parent 7ae1064 commit bd9e518

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/build-linux.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v1
2020

21+
- name: Setup ccache
22+
uses: hendrikmuhs/ccache-action@v1.2
23+
with:
24+
# Isolate writes per ref (branch/PR) to reduce cross-PR cache contamination.
25+
key: ccache-${{ runner.os }}-rocky9-cuda12.1.1-${{ github.ref_name }}-${{ hashFiles('CMakeLists.txt', 'src/CMakeLists.txt', 'vcpkg.json', 'vcpkg-configuration.json', '.github/workflows/build-linux.yml') }}
26+
restore-keys: |
27+
ccache-${{ runner.os }}-rocky9-cuda12.1.1-${{ github.ref_name }}-
28+
ccache-${{ runner.os }}-rocky9-cuda12.1.1-develop-
29+
ccache-${{ runner.os }}-
30+
max-size: "1000M"
31+
2132
- name: Prepare File Tree
2233
run: |
2334
mkdir ./build
@@ -30,6 +41,8 @@ jobs:
3041
run: |
3142
cmake .. \
3243
-G Ninja \
44+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
45+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
3346
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
3447
-DBUILD_SHARED_LIBS=ON \
3548
-DCMAKE_PREFIX_PATH="${DEPS_INSTALL_DIR}" \

0 commit comments

Comments
 (0)