7
7
- ' **'
8
8
9
9
jobs :
10
- # Build and test many combinations on Linux/OS X using Conan
11
- clang-tidy :
12
- container : johnmcfarlane/cnl_ci:clang-head-libcpp
13
- runs-on : ubuntu-20.04
14
- steps :
15
- - uses : actions/checkout@v2
16
-
17
- - name : Initialise Conan
18
- run : |
19
- conan config install $GITHUB_WORKSPACE/.github/conan/settings.yml
20
-
21
- - name : Install dependencies
22
- run : |
23
- conan install \
24
- --build=missing \
25
- --profile $GITHUB_WORKSPACE/.github/conan/profiles/linux-clang-head-libc++ \
26
- --settings build_type=Release \
27
- --options clang_tidy=True \
28
- --options int128=False \
29
- --options sanitize=False \
30
- --env CONAN_CMAKE_GENERATOR=Ninja \
31
- $GITHUB_WORKSPACE
32
-
33
- - name : Build tests
34
- run : conan build --build --configure $GITHUB_WORKSPACE
35
-
36
- - name : Test library
37
- run : conan build --test $GITHUB_WORKSPACE
38
-
39
- # Build and test latest on Linux using only CMake
40
- cmake :
41
- strategy :
42
- matrix :
43
- compiler : [clang, gcc]
44
- include :
45
- - compiler : clang
46
- stdlib-flag : " -stdlib=libc++"
47
- toolchain : clang-libc++.cmake
48
- container : johnmcfarlane/cnl_ci:clang-head-libcpp
49
- - compiler : gcc
50
- stdlib-flag : " "
51
- toolchain : gcc-head.cmake
52
- container : johnmcfarlane/cnl_ci:gcc-head
53
- build_type : ["Debug", "Release"]
54
- cxx-extensions : ["ON", "OFF"]
55
- exceptions : ["ON", "OFF"]
56
-
57
- container : ${{matrix.container}}
58
- runs-on : ubuntu-20.04
59
-
60
- steps :
61
- - uses : actions/checkout@v2
62
-
63
- - name : Restore caches
64
- uses : actions/cache@v2
65
- with :
66
- path : |
67
- /github/home/.ccache
68
- key : test-${{matrix.compiler}}-${{github.ref}}-${{github.sha}}
69
- restore-keys : |
70
- test-${{matrix.compiler}}-${{github.ref}}-
71
- test-${{matrix.compiler}}-main-
72
- test-${{matrix.compiler}}-
73
-
74
- - name : Build and Install GTest
75
- env :
76
- CXXFLAGS : ${{matrix.stdlib-flag}}
77
- run : |
78
- git clone https://github.com/google/googletest.git
79
- cd googletest
80
- git checkout 3c95bf552405fd0cc63cea0ca2f6c4cd89c8d356
81
- cmake \
82
- -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$GITHUB_WORKSPACE/test/toolchain/${{matrix.toolchain}} \
83
- .
84
- cmake --build . --target install
85
-
86
- - name : Configure CNL
87
- run : |
88
- cmake \
89
- -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
90
- -DCMAKE_CXX_EXTENSIONS=${{matrix.cxx-extensions}} \
91
- -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$GITHUB_WORKSPACE/test/toolchain/${{matrix.toolchain}} \
92
- -DCNL_EXCEPTIONS=${{matrix.exceptions}} \
93
- -DCNL_SANITIZE=ON \
94
- $GITHUB_WORKSPACE
95
-
96
- - name : Build CNL
97
- run : cmake --build $GITHUB_WORKSPACE --target test-all
98
-
99
- - name : Test CNL
100
- run : ctest --output-on-failure
101
-
102
- - name : ccache report
103
- run : ccache -s
104
-
105
- # Build and test many combinations on Linux/OS X using Conan
106
- conan :
107
- strategy :
108
- matrix :
109
- name : [
110
- clang-head-libc++, clang-head-libstdc++,
111
- clang-13-libc++, clang-13-libstdc++,
112
- clang-12-libstdc++,
113
- clang-11-libstdc++,
114
- clang-10-libstdc++,
115
- gcc-head, gcc-11, gcc-10, osx-clang-13, osx-gcc-11, gcc-10-armv7
116
- ]
117
- include :
118
- # Clang HEAD
119
- - name : clang-head-libc++
120
- linux-container : johnmcfarlane/cnl_ci:clang-head-libcpp
121
- os-version : ubuntu-20.04
122
- profile : linux-clang-head-libc++
123
- - name : clang-head-libstdc++
124
- linux-container : johnmcfarlane/cnl_ci:clang-head-libstdcpp
125
- os-version : ubuntu-20.04
126
- profile : linux-clang-head-libstdc++
127
-
128
- # Clang-13
129
- - name : clang-13-libc++
130
- linux-container : johnmcfarlane/cnl_ci:clang-13-libcpp
131
- os-version : ubuntu-20.04
132
- profile : linux-clang-13-libc++
133
- - name : clang-13-libstdc++
134
- linux-container : johnmcfarlane/cnl_ci:clang-13-libstdcpp
135
- os-version : ubuntu-20.04
136
- profile : linux-clang-13-libstdc++
137
-
138
- # Clang-12 (Contrary)
139
- - name : clang-12-libstdc++
140
- linux-container : johnmcfarlane/cnl_ci:clang-12-libstdcpp
141
- os-version : ubuntu-20.04
142
- profile : linux-clang-12-libstdc++
143
-
144
- # Clang-11
145
- - name : clang-11-libstdc++
146
- linux-container : johnmcfarlane/cnl_ci:clang-11-libstdcpp
147
- os-version : ubuntu-20.04
148
- profile : linux-clang-11-libstdc++
149
-
150
- # Clang-10
151
- - name : clang-10-libstdc++
152
- linux-container : johnmcfarlane/cnl_ci:clang-10-libstdcpp
153
- os-version : ubuntu-20.04
154
- profile : linux-clang-10-libstdc++
155
-
156
- # GCC HEAD
157
- - name : gcc-head
158
- linux-container : johnmcfarlane/cnl_ci:gcc-head
159
- os-version : ubuntu-20.04
160
- profile : linux-gcc-head
161
-
162
- # GCC-11
163
- - name : gcc-11
164
- linux-container : johnmcfarlane/cnl_ci:gcc-11
165
- os-version : ubuntu-20.04
166
- profile : linux-gcc-11
167
-
168
- # GCC-10
169
- - name : gcc-10
170
- linux-container : johnmcfarlane/cnl_ci:gcc-10
171
- os-version : ubuntu-20.04
172
- profile : linux-gcc-10
173
-
174
- # OS X Clang (latest)
175
- - name : osx-clang-13
176
- os-version : macos-10.15
177
- profile : osx-clang-13
178
-
179
- # OS X GCC-11
180
- - name : osx-gcc-11
181
- os-version : macos-10.15
182
- profile : osx-gcc-11
183
-
184
- # GCC-10 (for ARMv7)
185
- - name : gcc-10-armv7
186
- linux-container : johnmcfarlane/cnl_ci:gcc-10-arm
187
- os-version : ubuntu-20.04
188
- profile : linux-gcc-10-armv7
189
-
190
- container : ${{matrix.linux-container}}
191
-
192
- runs-on : ${{matrix.os-version}}
193
-
194
- steps :
195
- - uses : actions/checkout@v2
196
-
197
- - name : Restore caches
198
- uses : actions/cache@v2
199
- with :
200
- path : |
201
- /github/home/.conan/data
202
- /github/home/.ccache
203
- /Users/runner/Library/Caches/ccache
204
- key : test-${{matrix.name}}-${{github.ref}}-${{github.sha}}
205
- restore-keys : |
206
- test-${{matrix.name}}-${{github.ref}}-
207
- test-${{matrix.name}}-main-
208
- test-${{matrix.name}}-
209
-
210
- - name : Install Brew packages
211
- if : ( matrix.os-version == 'macos-10.15' )
212
- run : brew install ccache conan ninja
213
-
214
- - name : Initialise Conan
215
- run : |
216
- conan config install $GITHUB_WORKSPACE/.github/conan/settings.yml
217
-
218
- - name : Install dependencies
219
- run : |
220
- conan install \
221
- --build=missing \
222
- --profile $GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.profile}} \
223
- $GITHUB_WORKSPACE
224
-
225
- - name : Build tests
226
- run : conan build --build --configure $GITHUB_WORKSPACE
227
-
228
- - name : Test library
229
- if : ( matrix.name != 'gcc-10-armv7' )
230
- run : conan build --test $GITHUB_WORKSPACE
231
-
232
- - name : Run benchmarks
233
- if : ( matrix.name != 'clang-11' && matrix.name != 'gcc-10-armv7' )
234
- run : |
235
- ./test/benchmark/test-benchmark --benchmark_format=csv | tee result.csv \
236
- "${GITHUB_WORKSPACE}"/test/benchmark/report.py result.csv
237
-
238
- - name : ccache report
239
- run : ccache -s
240
-
241
- # Build and test on Windows using Conan
242
- windows :
243
- runs-on : windows-2019
244
- strategy :
245
- matrix :
246
- arch : [x86_64, x86]
247
- include :
248
- - arch : x86_64
249
- msbuild_property : x64
250
- profile : msvc-x86_64
251
- - arch : x86
252
- msbuild_property : win32
253
- profile : msvc-x86
254
-
255
- steps :
256
- - uses : actions/checkout@v2
257
-
258
- - name : Restore caches
259
- uses : actions/cache@v2
260
- with :
261
- path : |
262
- ~\AppData\Local\pip\Cache
263
- ~\.conan\data
264
- ~\.ccache
265
- key : test-${{matrix.arch}}-${{github.ref}}-${{github.sha}}
266
- restore-keys : |
267
- test-${{matrix.arch}}-${{github.ref}}-
268
- test-${{matrix.arch}}-main-
269
- test-${{matrix.arch}}-
270
-
271
- - name : Install Conan
272
- run : |
273
- pip.exe install conan;
274
-
275
- - name : Create build directory
276
- run : mkdir ${{runner.workspace}}\build
277
-
278
- - name : Install dependencies
279
- working-directory : ${{runner.workspace}}/build
280
- run : |
281
- conan install `
282
- --build=missing `
283
- --env CONAN_CMAKE_GENERATOR="Visual Studio 16 2019" `
284
- --settings build_type=Release `
285
- --profile $env:GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.profile}} `
286
- $env:GITHUB_WORKSPACE
287
-
288
- - name : Build and run tests
289
- working-directory : ${{runner.workspace}}/build
290
- run : conan build --build --configure --test $env:GITHUB_WORKSPACE
291
-
292
- - name : Run benchmarks
293
- working-directory : ${{runner.workspace}}/build
294
- run : test\benchmark\Release\test-benchmark.exe
295
-
296
- # Install on mature Linux distro using only CMake
297
- install :
298
- runs-on : ubuntu-18.04
299
- steps :
300
- - uses : actions/checkout@v2
301
-
302
- - name : Configure CNL
303
- run : cmake $GITHUB_WORKSPACE
304
-
305
- - name : Install CNL
306
- run : sudo cmake --build $GITHUB_WORKSPACE --target install
307
-
308
- # Test source formatting
309
- clang-format :
310
- runs-on : ubuntu-20.04
311
- container : johnmcfarlane/cnl_ci:clang-13
312
- steps :
313
- - uses : actions/checkout@v2
314
-
315
- - name : Format code
316
- shell : bash
317
- run : $GITHUB_WORKSPACE/test/scripts/clang-format
318
-
319
- - name : Show/test for changes
320
- shell : bash
321
- run : |
322
- git diff
323
- if [[ `git status --porcelain` ]]; then exit 1; fi
324
-
325
- # Test shell scripts
326
- shellcheck :
327
- runs-on : ubuntu-20.04
328
- container : johnmcfarlane/cnl_ci:base-20.04
329
- steps :
330
- - uses : actions/checkout@v2
331
-
332
- - name : Run shellcheck
333
- shell : bash
334
- run : $GITHUB_WORKSPACE/test/scripts/shellcheck
335
-
336
- # Test markdown
337
- markdownlint :
338
- runs-on : ubuntu-20.04
339
- steps :
340
- - uses : actions/checkout@v2
341
-
342
- - name : Run markdownlint
343
- shell : bash
344
- run : |
345
- sudo snap install mdl
346
- $GITHUB_WORKSPACE/test/scripts/markdownlint
347
-
348
10
# Test YAML
349
11
yamllint :
350
12
runs-on : ubuntu-20.04
@@ -356,24 +18,4 @@ jobs:
356
18
run : |
357
19
sudo apt install yamllint
358
20
$GITHUB_WORKSPACE/test/scripts/yamllint
359
-
360
- # Test documentation generation
361
- doxygen :
362
- runs-on : ubuntu-18.04
363
- container : johnmcfarlane/cnl_ci:gcc-10
364
- steps :
365
- - uses : actions/checkout@v2
366
- with :
367
- fetch-depth : 0
368
- submodules : true
369
-
370
- - name : Generate documentation
371
- shell : bash
372
- run : $GITHUB_WORKSPACE/doc/generate
373
-
374
- - name : Upload documentation
375
- uses : actions/upload-artifact@v2
376
- with :
377
- name : documentation
378
- path : ${{github.workspace}}/htdocs
379
21
...
0 commit comments