@@ -16,14 +16,30 @@ jobs:
16
16
# user input
17
17
DEBIAN_FRONTEND : noninteractive
18
18
run : |
19
- sudo apt-get install -yq gcc gdb g++ maven jq flex bison libxml2-utils
19
+ sudo apt-get install -yq gcc gdb g++ maven jq flex bison libxml2-utils ccache
20
20
make -C src minisat2-download
21
+ - name : Prepare ccache
22
+ uses : actions/cache@v2
23
+ with :
24
+ path : .ccache
25
+ key : ${{ runner.os }}-20.04-make-${{ github.ref }}-${{ github.sha }}
26
+ restore-keys : |
27
+ ${{ runner.os }}-20.04-make-${{ github.ref }}
28
+ ${{ runner.os }}-20.04-make
29
+ - name : ccache environment
30
+ run : |
31
+ echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
32
+ echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
33
+ - name : Zero ccache stats and limit in size
34
+ run : ccache -z --max-size=500M
21
35
- name : Build with make
22
36
run : |
23
- make -C src CXX='/usr/bin/g++' -j2
24
- make -C unit CXX='/usr/bin/g++' -j2
25
- make -C jbmc/src CXX='/usr/bin/g++' -j2
26
- make -C jbmc/unit CXX='/usr/bin/g++' -j2
37
+ make -C src CXX='ccache /usr/bin/g++' -j2
38
+ make -C unit CXX='ccache /usr/bin/g++' -j2
39
+ make -C jbmc/src CXX='ccache /usr/bin/g++' -j2
40
+ make -C jbmc/unit CXX='ccache /usr/bin/g++' -j2
41
+ - name : Print ccache stats
42
+ run : ccache -s
27
43
- name : Run unit tests
28
44
run : |
29
45
make -C unit test
@@ -50,14 +66,30 @@ jobs:
50
66
# user input
51
67
DEBIAN_FRONTEND : noninteractive
52
68
run : |
53
- sudo apt-get install -yq cmake ninja-build gcc g++ maven flex bison libxml2-utils dpkg-dev
69
+ sudo apt-get install -yq cmake ninja-build gcc g++ maven flex bison libxml2-utils dpkg-dev ccache
70
+ - name : Prepare ccache
71
+ uses : actions/cache@v2
72
+ with :
73
+ path : .ccache
74
+ key : ${{ runner.os }}-20.04-Release-${{ github.ref }}-${{ github.sha }}
75
+ restore-keys : |
76
+ ${{ runner.os }}-20.04-Release-${{ github.ref }}
77
+ ${{ runner.os }}-20.04-Release
78
+ - name : ccache environment
79
+ run : |
80
+ echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
81
+ echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
54
82
- name : Configure using CMake
55
83
run : |
56
84
mkdir build
57
85
cd build
58
86
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
87
+ - name : Zero ccache stats and limit in size
88
+ run : ccache -z --max-size=500M
59
89
- name : Build with Ninja
60
90
run : cd build; ninja -j2
91
+ - name : Print ccache stats
92
+ run : ccache -s
61
93
- name : Check if package building works
62
94
run : |
63
95
cd build
@@ -73,14 +105,30 @@ jobs:
73
105
with :
74
106
submodules : true
75
107
- name : Fetch dependencies
76
- run : brew install maven flex bison parallel
108
+ run : brew install maven flex bison parallel ccache
109
+ - name : Prepare ccache
110
+ uses : actions/cache@v2
111
+ with :
112
+ path : .ccache
113
+ key : ${{ runner.os }}-make-${{ github.ref }}-${{ github.sha }}
114
+ restore-keys : |
115
+ ${{ runner.os }}-make-${{ github.ref }}
116
+ ${{ runner.os }}-make
117
+ - name : ccache environment
118
+ run : |
119
+ echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
120
+ echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
121
+ - name : Zero ccache stats and limit in size
122
+ run : ccache -z --max-size=500M
77
123
- name : Build using Make
78
124
run : |
79
125
make -C src minisat2-download
80
- make -C src -j2
81
- make -C jbmc/src -j2
82
- make -C unit
83
- make -C jbmc/unit
126
+ make -C src -j2 CXX="ccache clang++"
127
+ make -C jbmc/src -j2 CXX="ccache clang++"
128
+ make -C unit "CXX=ccache clang++"
129
+ make -C jbmc/unit "CXX=ccache clang++"
130
+ - name : Print ccache stats
131
+ run : ccache -s
84
132
- name : Run unit tests
85
133
run : cd unit; ./unit_tests
86
134
- name : Run JBMC unit tests
@@ -97,14 +145,30 @@ jobs:
97
145
with :
98
146
submodules : true
99
147
- name : Fetch dependencies
100
- run : brew install cmake ninja maven flex bison
148
+ run : brew install cmake ninja maven flex bison ccache
149
+ - name : Prepare ccache
150
+ uses : actions/cache@v2
151
+ with :
152
+ path : .ccache
153
+ key : ${{ runner.os }}-Release-${{ github.ref }}-${{ github.sha }}
154
+ restore-keys : |
155
+ ${{ runner.os }}-Release-${{ github.ref }}
156
+ ${{ runner.os }}-Release
157
+ - name : ccache environment
158
+ run : |
159
+ echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
160
+ echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
161
+ - name : Zero ccache stats and limit in size
162
+ run : ccache -z --max-size=500M
101
163
- name : Configure using CMake
102
164
run : |
103
165
mkdir build
104
166
cd build
105
167
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
106
168
- name : Build with Ninja
107
169
run : cd build; ninja -j2
170
+ - name : Print ccache stats
171
+ run : ccache -s
108
172
- name : Run CTest
109
173
run : cd build; ctest -V -L CORE . -j2
110
174
@@ -187,7 +251,21 @@ jobs:
187
251
- name : Fetch dependencies
188
252
run : |
189
253
choco install winflexbison3
254
+ nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0
255
+ echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
190
256
-
uses :
microsoft/[email protected]
257
+ - name : Prepare ccache
258
+ uses : actions/cache@v2
259
+ with :
260
+ path : .ccache
261
+ key : ${{ runner.os }}-msbuild-${{ github.ref }}-${{ github.sha }}
262
+ restore-keys : |
263
+ ${{ runner.os }}-msbuild-${{ github.ref }}
264
+ ${{ runner.os }}-msbuild
265
+ - name : ccache environment
266
+ run : |
267
+ echo "CLCACHE_BASEDIR=$((Get-Item -Path '.\').FullName)" >> $env:GITHUB_ENV
268
+ echo "CLCACHE_DIR=$pwd\.ccache" >> $env:GITHUB_ENV
191
269
- name : Configure with cmake
192
270
run : |
193
271
New-Item -ItemType Directory -Path build
@@ -196,7 +274,9 @@ jobs:
196
274
- name : Build Release
197
275
run : |
198
276
Set-Location build
199
- cmake --build . --config Release -- /p:CL_MPcount=2
277
+ cmake --build . --config Release -- /p:CL_MPcount=2 /p:CLToolExe=clcache
278
+ - name : Print ccache stats
279
+ run : clcache -s
200
280
- name : Create packages
201
281
id : create_packages
202
282
# We need to get the path to cpack because fascinatingly,
@@ -218,7 +298,21 @@ jobs:
218
298
with :
219
299
submodules : recursive
220
300
- name : Fetch dependencies
221
- run : sudo apt install g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev
301
+ run : sudo apt install g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache
302
+ - name : Prepare ccache
303
+ uses : actions/cache@v2
304
+ with :
305
+ path : .ccache
306
+ key : ${{ runner.os }}-18.04-Release-${{ github.ref }}-${{ github.sha }}
307
+ restore-keys : |
308
+ ${{ runner.os }}-18.04-Release-${{ github.ref }}
309
+ ${{ runner.os }}-18.04-Release
310
+ - name : ccache environment
311
+ run : |
312
+ echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
313
+ echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
314
+ - name : Zero ccache stats and limit in size
315
+ run : ccache -z --max-size=500M
222
316
- name : Configure CMake
223
317
run : |
224
318
mkdir build
@@ -228,6 +322,8 @@ jobs:
228
322
run : |
229
323
cd build
230
324
ninja -j2
325
+ - name : Print ccache stats
326
+ run : ccache -s
231
327
- name : Run CTest
232
328
run : cd build; ctest . -V -L CORE -C Release -j2
233
329
- name : Create packages
0 commit comments