-
Notifications
You must be signed in to change notification settings - Fork 172
278 lines (273 loc) · 10.1 KB
/
cmake-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
name: CMake CI
on:
- push
- pull_request
- workflow_dispatch
jobs:
test-linux:
runs-on: ubuntu-latest
env:
CCACHE_DIR: ${{github.workspace}}/ccache
CCACHE_MAXSIZE: 400M
CCACHE_COMPILERCHECK: content
strategy:
matrix:
tag:
- minimal
- no-asm
- gui-full
- system-libs
include:
- tag: no-asm
deps: null
options: -DENABLE_PIE=ON -DUSE_ASM=OFF
- tag: gui-full
deps: >-
libminiupnpc-dev
libqrencode-dev
qtbase5-dev
qttools5-dev
options: >-
-DENABLE_GUI=ON
-DENABLE_QRENCODE=ON
-DENABLE_UPNP=ON
-DUSE_DBUS=ON
- tag: system-libs
deps: >-
libdb5.3++-dev
libleveldb-dev
libsnappy-dev
libsecp256k1-dev
libunivalue-dev
xxd
options: >-
-DSYSTEM_BDB=ON
-DSYSTEM_LEVELDB=ON
-DSYSTEM_UNIVALUE=ON
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: |
${{matrix.deps}}
ccache
libcurl4-openssl-dev
libzip-dev
ninja-build
zipcmp
zipmerge
ziptool
version: ${{matrix.tag}}
- name: Install Boost dependencies
run: |
sudo apt-get install -y --no-install-recommends \
libboost-dev \
libboost-date-time-dev \
libboost-exception-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-serialization-dev \
libboost-test-dev \
libboost-thread-dev
- name: Configure
run: |
cmake -B ${{github.workspace}}/build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
${{matrix.options}} \
-DENABLE_TESTS=ON
- name: Restore cache
uses: actions/cache/restore@v3
if: always()
with:
path: ${{env.CCACHE_DIR}}
key: ccache-linux-${{matrix.tag}}-${{github.run_id}}
restore-keys: |
ccache-linux-${{matrix.tag}}-
- name: Build
run: |
cmake --build ${{github.workspace}}/build -v -j $(nproc)
- name: Save cache
uses: actions/cache/save@v3
if: always()
with:
path: ${{env.CCACHE_DIR}}
key: ccache-linux-${{matrix.tag}}-${{github.run_id}}
- name: Run tests
run: |
ctest --test-dir ${{github.workspace}}/build -j $(nproc)
- name: Upload test logs
uses: actions/upload-artifact@v3
if: always()
with:
name: testlog-linux-${{matrix.tag}}
path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log
retention-days: 7
test-macos:
runs-on: macos-latest
env:
CCACHE_DIR: ${{github.workspace}}/ccache
CCACHE_MAXSIZE: 400M
CCACHE_COMPILERCHECK: content
strategy:
matrix:
tag:
- minimal
- no-asm
- gui-full
- system-libs
include:
- tag: no-asm
deps: null
options: -DENABLE_PIE=ON -DUSE_ASM=OFF
- tag: gui-full
deps: >-
miniupnpc
qrencode
qt@5
options: >-
-DENABLE_GUI=ON
-DQt5_DIR=/usr/local/opt/qt@5/lib/cmake/Qt5
-DENABLE_QRENCODE=ON
-DENABLE_UPNP=ON
- tag: system-libs
deps: >-
berkeley-db@5
secp256k1
vim
options: >-
-DSYSTEM_BDB=ON
-DBerkeleyDB_INCLUDE_DIR=/usr/local/opt/berkeley-db@5/include
-DBerkeleyDB_CXX_LIBRARY=/usr/local/opt/berkeley-db@5/lib/libdb_cxx.dylib
-DSYSTEM_SECP256K1=ON
-DSYSTEM_XXD=ON
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
brew install boost ccache ninja ${{matrix.deps}}
- name: Configure
run: |
PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig:${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
pushd src
../contrib/nomacro.pl
popd
cmake -B ${{github.workspace}}/build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
${{matrix.options}} \
-DENABLE_TESTS=ON
- name: Restore cache
uses: actions/cache/restore@v3
if: always()
with:
path: ${{env.CCACHE_DIR}}
key: ccache-macos-${{matrix.tag}}-${{github.run_id}}
restore-keys: |
ccache-macos-${{matrix.tag}}-
- name: Build
run: |
cmake --build ${{github.workspace}}/build -v -j $(sysctl -n hw.logicalcpu)
- name: Save cache
uses: actions/cache/save@v3
if: always()
with:
path: ${{env.CCACHE_DIR}}
key: ccache-macos-${{matrix.tag}}-${{github.run_id}}
- name: Run tests
run: |
ctest --test-dir ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)
- name: Upload test logs
uses: actions/upload-artifact@v3
if: always()
with:
name: testlog-macos-${{matrix.tag}}
path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log
retention-days: 7
test-msys2:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
env:
CCACHE_DIR: ${{github.workspace}}\ccache
CCACHE_MAXSIZE: 400M
CCACHE_COMPILERCHECK: content
strategy:
matrix:
tag:
- minimal
- no-asm
- gui-full
include:
- tag: no-asm
deps: null
options: -DUSE_ASM=OFF
- tag: gui-full
deps: >-
miniupnpc:p
qrencode:p
qt5-base:p
qt5-tools:p
options: >-
-DENABLE_GUI=ON
-DENABLE_QRENCODE=ON
-DENABLE_UPNP=ON
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
make
ninja
pacboy: >-
${{matrix.deps}}
boost:p
ccache:p
cmake:p
curl:p
libzip:p
openssl:p
toolchain:p
- name: Configure
run: |
cmake -B ./build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
${{matrix.options}} \
-DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=ON
- name: Restore cache
uses: actions/cache/restore@v3
if: always()
with:
path: ${{env.CCACHE_DIR}}
key: ccache-msys2-${{matrix.tag}}-${{github.run_id}}
restore-keys: |
ccache-msys2-${{matrix.tag}}-
- name: Build
run: |
cmake --build ./build -v -j $NUMBER_OF_PROCESSORS
- name: Save cache
uses: actions/cache/save@v3
if: always()
with:
path: ${{env.CCACHE_DIR}}
key: ccache-msys2-${{matrix.tag}}-${{github.run_id}}
- name: Run tests
run: |
ctest --test-dir ./build -j $NUMBER_OF_PROCESSORS
- name: Upload test logs
uses: actions/upload-artifact@v3
if: always()
with:
name: testlog-msys-${{matrix.tag}}
path: ${{github.workspace}}\build\Testing\Temporary\LastTest.log
retention-days: 7