Skip to content

Commit d656d9f

Browse files
committed
Add ccache to CI workflow for faster builds
1 parent 729d0a9 commit d656d9f

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

.github/workflows/build-clang.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ jobs:
1717
- name: Install dependencies
1818
run: |
1919
sudo apt-get update
20-
sudo apt-get install -y ninja-build cmake build-essential
20+
sudo apt-get install -y ninja-build cmake build-essential ccache
21+
22+
- name: Setup ccache
23+
uses: actions/cache@v4
24+
with:
25+
path: ~/.ccache
26+
key: ccache-linux-${{ github.sha }}
27+
restore-keys: |
28+
ccache-linux-
2129
2230
- name: Configure build
2331
run: |
@@ -29,6 +37,8 @@ jobs:
2937
-DLLVM_TARGETS_TO_BUILD="X86" \
3038
-DLLVM_ENABLE_ASSERTIONS=OFF \
3139
-DCMAKE_INSTALL_PREFIX=../install \
40+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
41+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
3242
../llvm
3343
3444
- name: Build Clang and clangd
@@ -99,7 +109,15 @@ jobs:
99109

100110
- name: Install dependencies
101111
run: |
102-
brew install ninja cmake
112+
brew install ninja cmake ccache
113+
114+
- name: Setup ccache
115+
uses: actions/cache@v4
116+
with:
117+
path: ~/Library/Caches/ccache
118+
key: ccache-macos-${{ github.sha }}
119+
restore-keys: |
120+
ccache-macos-
103121
104122
- name: Configure build
105123
run: |
@@ -111,6 +129,8 @@ jobs:
111129
-DLLVM_TARGETS_TO_BUILD="AArch64;X86" \
112130
-DLLVM_ENABLE_ASSERTIONS=OFF \
113131
-DCMAKE_INSTALL_PREFIX=../install \
132+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
133+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
114134
../llvm
115135
116136
- name: Build Clang and clangd
@@ -169,7 +189,15 @@ jobs:
169189

170190
- name: Install dependencies
171191
run: |
172-
choco install ninja cmake
192+
choco install ninja cmake sccache
193+
194+
- name: Setup sccache
195+
uses: actions/cache@v4
196+
with:
197+
path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache
198+
key: sccache-windows-${{ github.sha }}
199+
restore-keys: |
200+
sccache-windows-
173201
174202
- name: Configure build
175203
run: |
@@ -181,6 +209,8 @@ jobs:
181209
-DLLVM_TARGETS_TO_BUILD="X86" `
182210
-DLLVM_ENABLE_ASSERTIONS=OFF `
183211
-DCMAKE_INSTALL_PREFIX=../install `
212+
-DCMAKE_C_COMPILER_LAUNCHER=sccache `
213+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache `
184214
../llvm
185215
186216
- name: Build Clang and clangd

0 commit comments

Comments
 (0)