Skip to content

Commit 5fccfa4

Browse files
committed
CI-unixish.yml: use ccache for Linux gcc make builds
1 parent 213fb83 commit 5fccfa4

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/CI-unixish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ jobs:
107107
steps:
108108
- uses: actions/checkout@v2
109109

110+
- name: ccache
111+
uses: hendrikmuhs/ccache-action@v1.2
112+
if: contains(matrix.os, 'ubuntu')
113+
with:
114+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
115+
110116
# coreutils contains "nproc"
111117
- name: Install missing software on macos
112118
if: contains(matrix.os, 'macos')
@@ -115,6 +121,7 @@ jobs:
115121
116122
- name: Build with Unsigned char
117123
run: |
124+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
118125
make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
119126
120127
- name: Test with Unsigned char
@@ -133,6 +140,12 @@ jobs:
133140
steps:
134141
- uses: actions/checkout@v2
135142

143+
- name: ccache
144+
uses: hendrikmuhs/ccache-action@v1.2
145+
if: contains(matrix.os, 'ubuntu')
146+
with:
147+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
148+
136149
# coreutils contains "nproc"
137150
- name: Install missing software on macos
138151
if: contains(matrix.os, 'macos')
@@ -141,6 +154,7 @@ jobs:
141154
142155
- name: Build with TEST_MATHLIB_VALUE
143156
run: |
157+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
144158
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all
145159
146160
- name: Test with TEST_MATHLIB_VALUE
@@ -194,16 +208,24 @@ jobs:
194208
run: |
195209
brew install coreutils qt@5
196210
211+
- name: ccache
212+
uses: hendrikmuhs/ccache-action@v1.2
213+
if: contains(matrix.os, 'ubuntu')
214+
with:
215+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
216+
197217
- name: Build GUI on ubuntu
198218
if: contains(matrix.os, 'ubuntu')
199219
run: |
220+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
200221
pushd gui
201222
qmake CONFIG+=debug HAVE_QCHART=yes
202223
make -j$(nproc)
203224
204225
- name: Run GUI tests on ubuntu
205226
if: contains(matrix.os, 'ubuntu')
206227
run: |
228+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
207229
pushd gui/test/cppchecklibrarydata
208230
qmake CONFIG+=debug
209231
make -j$(nproc)
@@ -241,6 +263,7 @@ jobs:
241263
- name: Build triage on ubuntu
242264
if: contains(matrix.os, 'ubuntu')
243265
run: |
266+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
244267
pushd tools/triage
245268
qmake CONFIG+=debug
246269
make -j$(nproc)
@@ -275,6 +298,12 @@ jobs:
275298
steps:
276299
- uses: actions/checkout@v2
277300

301+
- name: ccache
302+
uses: hendrikmuhs/ccache-action@v1.2
303+
if: contains(matrix.os, 'ubuntu')
304+
with:
305+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
306+
278307
- name: Install missing software on ubuntu
279308
if: contains(matrix.os, 'ubuntu')
280309
run: |
@@ -300,10 +329,12 @@ jobs:
300329
301330
- name: Build cppcheck
302331
run: |
332+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
303333
make -j$(nproc) HAVE_RULES=yes
304334
305335
- name: Build test
306336
run: |
337+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
307338
make -j$(nproc) testrunner HAVE_RULES=yes
308339
309340
- name: Run test
@@ -395,13 +426,19 @@ jobs:
395426
steps:
396427
- uses: actions/checkout@v2
397428

429+
- name: ccache
430+
uses: hendrikmuhs/ccache-action@v1.2
431+
with:
432+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
433+
398434
- name: Install missing software on ubuntu
399435
run: |
400436
sudo apt-get update
401437
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev
402438
403439
- name: Self check (build)
404440
run: |
441+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
405442
# compile with verification and ast matchers
406443
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2" MATCHCOMPILER=yes VERIFY=1
407444

0 commit comments

Comments
 (0)