|
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:host 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 | | - generator: "Unix Makefiles" |
121 | | - linux-container: johnmcfarlane/cnl_ci:clang-head-libcpp |
122 | | - os-version: ubuntu-20.04 |
123 | | - profile: linux-clang-head-libc++ |
124 | | - - name: clang-head-libstdc++ |
125 | | - linux-container: johnmcfarlane/cnl_ci:clang-head-libstdcpp |
126 | | - os-version: ubuntu-20.04 |
127 | | - profile: linux-clang-head-libstdc++ |
128 | | - |
129 | | - # Clang-13 |
130 | | - - name: clang-13-libc++ |
131 | | - linux-container: johnmcfarlane/cnl_ci:clang-13-libcpp |
132 | | - os-version: ubuntu-20.04 |
133 | | - profile: linux-clang-13-libc++ |
134 | | - - name: clang-13-libstdc++ |
135 | | - linux-container: johnmcfarlane/cnl_ci:clang-13-libstdcpp |
136 | | - os-version: ubuntu-20.04 |
137 | | - profile: linux-clang-13-libstdc++ |
138 | | - |
139 | | - # Clang-12 (Contrary) |
140 | | - - name: clang-12-libstdc++ |
141 | | - generator: "Unix Makefiles" |
142 | | - linux-container: johnmcfarlane/cnl_ci:clang-12-libstdcpp |
143 | | - os-version: ubuntu-20.04 |
144 | | - profile: linux-clang-12-libstdc++ |
145 | | - |
146 | | - # Clang-11 |
147 | | - - name: clang-11-libstdc++ |
148 | | - linux-container: johnmcfarlane/cnl_ci:clang-11-libstdcpp |
149 | | - os-version: ubuntu-20.04 |
150 | | - profile: linux-clang-11-libstdc++ |
151 | | - |
152 | | - # Clang-10 |
153 | | - - name: clang-10-libstdc++ |
154 | | - linux-container: johnmcfarlane/cnl_ci:clang-10-libstdcpp |
155 | | - os-version: ubuntu-20.04 |
156 | | - profile: linux-clang-10-libstdc++ |
157 | | - |
158 | | - # GCC HEAD |
159 | | - - name: gcc-head |
160 | | - linux-container: johnmcfarlane/cnl_ci:gcc-head |
161 | | - os-version: ubuntu-20.04 |
162 | | - profile: linux-gcc-head |
163 | | - |
164 | | - # GCC-11 |
165 | | - - name: gcc-11 |
166 | | - linux-container: johnmcfarlane/cnl_ci:gcc-11 |
167 | | - os-version: ubuntu-20.04 |
168 | | - profile: linux-gcc-11 |
169 | | - |
170 | | - # GCC-10 |
171 | | - - name: gcc-10 |
172 | | - generator: "Unix Makefiles" |
173 | | - linux-container: johnmcfarlane/cnl_ci:gcc-10 |
174 | | - os-version: ubuntu-20.04 |
175 | | - profile: linux-gcc-10 |
176 | | - |
177 | | - # OS X Clang (latest) |
178 | | - - name: osx-clang-13 |
179 | | - os-version: macos-10.15 |
180 | | - profile: osx-clang-13 |
181 | | - |
182 | | - # OS X GCC-11 |
183 | | - - name: osx-gcc-11 |
184 | | - os-version: macos-10.15 |
185 | | - profile: osx-gcc-11 |
186 | | - |
187 | | - # GCC-10 (for ARMv7) |
188 | | - - name: gcc-10-armv7 |
189 | | - linux-container: johnmcfarlane/cnl_ci:gcc-10-arm |
190 | | - os-version: ubuntu-20.04 |
191 | | - profile: linux-gcc-10-armv7 |
192 | | - |
193 | | - container: ${{matrix.linux-container}} |
194 | | - |
195 | | - runs-on: ${{matrix.os-version}} |
196 | | - |
197 | | - steps: |
198 | | - - uses: actions/checkout@v2 |
199 | | - |
200 | | - - name: Restore caches |
201 | | - uses: actions/cache@v2 |
202 | | - with: |
203 | | - path: | |
204 | | - /github/home/.conan/data |
205 | | - /github/home/.ccache |
206 | | - /Users/runner/Library/Caches/ccache |
207 | | - key: test-${{matrix.name}}-${{github.ref}}-${{github.sha}} |
208 | | - restore-keys: | |
209 | | - test-${{matrix.name}}-${{github.ref}}- |
210 | | - test-${{matrix.name}}-main- |
211 | | - test-${{matrix.name}}- |
212 | | -
|
213 | | - - name: Install Brew packages |
214 | | - if: ( matrix.os-version == 'macos-10.15' ) |
215 | | - run: brew install ccache conan ninja |
216 | | - |
217 | | - - name: Initialise Conan |
218 | | - run: | |
219 | | - conan config install $GITHUB_WORKSPACE/.github/conan/settings.yml |
220 | | -
|
221 | | - - name: Install dependencies |
222 | | - env: |
223 | | - CONAN_CMAKE_GENERATOR: "${{matrix.generator}}" |
224 | | - run: | |
225 | | - conan install \ |
226 | | - --build=missing \ |
227 | | - --env:build CONAN_CMAKE_GENERATOR="${CONAN_CMAKE_GENERATOR:-Ninja}" \ |
228 | | - --env:host CONAN_CMAKE_GENERATOR="${CONAN_CMAKE_GENERATOR:-Ninja}" \ |
229 | | - --profile $GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.profile}} \ |
230 | | - --settings:build cmake:compiler.cppstd=gnu11 \ |
231 | | - $GITHUB_WORKSPACE |
232 | | -
|
233 | | - - name: Build tests |
234 | | - run: conan build --build --configure --install $GITHUB_WORKSPACE |
235 | | - |
236 | | - - name: Test library |
237 | | - if: ( matrix.name != 'gcc-10-armv7' ) |
238 | | - run: conan build --test $GITHUB_WORKSPACE |
239 | | - |
240 | | - - name: Run benchmarks |
241 | | - if: ( matrix.name != 'clang-11' && matrix.name != 'gcc-10-armv7' ) |
242 | | - run: | |
243 | | - ./test/benchmark/test-benchmark --benchmark_format=csv | tee result.csv \ |
244 | | - "${GITHUB_WORKSPACE}"/test/benchmark/report.py result.csv |
245 | | -
|
246 | | - - name: ccache report |
247 | | - run: ccache -s |
248 | | - |
249 | | - # Build and test on Windows using Conan |
250 | | - windows: |
251 | | - strategy: |
252 | | - matrix: |
253 | | - name: [2022-64, 2022-32, 2019-64, 2019-32] |
254 | | - include: |
255 | | - - name: 2022-64 |
256 | | - build-profile: msvc-17-x86_64 |
257 | | - host-profile: msvc-17-x86_64 |
258 | | - runs-on: "windows-2022" |
259 | | - - name: 2022-32 |
260 | | - build-profile: msvc-17-x86_64 |
261 | | - host-profile: msvc-17-x86 |
262 | | - runs-on: "windows-2022" |
263 | | - - name: 2019-64 |
264 | | - build-profile: msvc-16-x86_64 |
265 | | - host-profile: msvc-16-x86_64 |
266 | | - runs-on: "windows-2019" |
267 | | - - name: 2019-32 |
268 | | - build-profile: msvc-16-x86_64 |
269 | | - host-profile: msvc-16-x86 |
270 | | - runs-on: "windows-2019" |
271 | | - build_type: ["Debug", "Release"] |
272 | | - |
273 | | - runs-on: ${{matrix.runs-on}} |
274 | | - |
275 | | - steps: |
276 | | - - uses: actions/checkout@v2 |
277 | | - |
278 | | - - name: Restore caches |
279 | | - uses: actions/cache@v2 |
280 | | - with: |
281 | | - path: | |
282 | | - ~\AppData\Local\pip\Cache |
283 | | - ~\.conan\data |
284 | | - ~\.ccache |
285 | | - key: test-${{matrix.name}}-${{github.ref}}-${{github.sha}} |
286 | | - restore-keys: | |
287 | | - test-${{matrix.name}}-${{github.ref}}- |
288 | | - test-${{matrix.name}}-main- |
289 | | - test-${{matrix.name}}- |
290 | | -
|
291 | | - - name: Install Conan |
292 | | - run: | |
293 | | - pip.exe install conan; |
294 | | -
|
295 | | - - name: Create build directory |
296 | | - run: mkdir ${{runner.workspace}}\build |
297 | | - |
298 | | - - name: Install dependencies |
299 | | - working-directory: ${{runner.workspace}}/build |
300 | | - run: | |
301 | | - conan install ` |
302 | | - --build=missing ` |
303 | | - --profile:build $env:GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.build-profile}} ` |
304 | | - --profile:host $env:GITHUB_WORKSPACE/.github/conan/profiles/${{matrix.host-profile}} ` |
305 | | - --settings:build build_type=Release ` |
306 | | - --settings:build cmake:compiler.cppstd=17 ` |
307 | | - --settings:host build_type="${{matrix.build_type}}" ` |
308 | | - $env:GITHUB_WORKSPACE |
309 | | -
|
310 | | - - name: Build and run tests |
311 | | - working-directory: ${{runner.workspace}}/build |
312 | | - run: conan build --build --configure --test $env:GITHUB_WORKSPACE |
313 | | - |
314 | | - - name: Run benchmarks |
315 | | - working-directory: ${{runner.workspace}}/build |
316 | | - run: test\benchmark\${{matrix.build_type}}\test-benchmark.exe |
317 | | - |
318 | | - # Install on mature Linux distro using only CMake |
319 | | - install: |
320 | | - runs-on: ubuntu-18.04 |
321 | | - steps: |
322 | | - - uses: actions/checkout@v2 |
323 | | - |
324 | | - - name: Configure CNL |
325 | | - run: cmake $GITHUB_WORKSPACE |
326 | | - |
327 | | - - name: Install CNL |
328 | | - run: sudo cmake --build $GITHUB_WORKSPACE --target install |
329 | | - |
330 | | - # Test source formatting |
331 | | - clang-format: |
332 | | - runs-on: ubuntu-20.04 |
333 | | - container: johnmcfarlane/cnl_ci:clang-13 |
334 | | - steps: |
335 | | - - uses: actions/checkout@v2 |
336 | | - |
337 | | - - name: Format code |
338 | | - shell: bash |
339 | | - run: $GITHUB_WORKSPACE/test/scripts/clang-format |
340 | | - |
341 | | - - name: Show/test for changes |
342 | | - shell: bash |
343 | | - run: | |
344 | | - git diff |
345 | | - if [[ `git status --porcelain` ]]; then exit 1; fi |
346 | | -
|
347 | | - # Test shell scripts |
348 | | - shellcheck: |
349 | | - runs-on: ubuntu-20.04 |
350 | | - container: johnmcfarlane/cnl_ci:base-20.04 |
351 | | - steps: |
352 | | - - uses: actions/checkout@v2 |
353 | | - |
354 | | - - name: Run shellcheck |
355 | | - shell: bash |
356 | | - run: $GITHUB_WORKSPACE/test/scripts/shellcheck |
357 | | - |
358 | | - # Test markdown |
359 | | - markdownlint: |
360 | | - runs-on: ubuntu-20.04 |
361 | | - steps: |
362 | | - - uses: actions/checkout@v2 |
363 | | - |
364 | | - - name: Run markdownlint |
365 | | - shell: bash |
366 | | - run: | |
367 | | - sudo snap install mdl |
368 | | - $GITHUB_WORKSPACE/test/scripts/markdownlint |
369 | | -
|
370 | | - # Test YAML |
371 | | - yamllint: |
372 | | - runs-on: ubuntu-20.04 |
373 | | - steps: |
374 | | - - uses: actions/checkout@v2 |
375 | | - |
376 | | - - name: Run yamllint |
377 | | - shell: bash |
378 | | - run: | |
379 | | - sudo apt install yamllint |
380 | | - $GITHUB_WORKSPACE/test/scripts/yamllint |
381 | | -
|
382 | 10 | # Test documentation generation |
383 | 11 | doxygen: |
384 | 12 | runs-on: ubuntu-18.04 |
|
0 commit comments