-
Notifications
You must be signed in to change notification settings - Fork 31
278 lines (224 loc) · 8.26 KB
/
ci v2.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: CI v2
on:
push:
branches:
- v2
pull_request:
branches:
- v2
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
cache_deps:
strategy:
matrix:
config: [{name: ci-ubuntu-gcc, os: ubuntu-latest},
{name: ci-ubuntu-clang, os: ubuntu-latest},
{name: ci-windows, os: windows-latest},
{name: ci-macos, os: macos-latest}]
build_type: [{config: Release}, {config: Debug}]
timeout-minutes: 120
runs-on: ${{ matrix.config.os }}
name: Cache deps on ${{ matrix.config.name }} for ${{ matrix.build_type.config }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.6.x - 3.11.x'
- name: get conan
uses: turtlebrowser/get-conan@main
- name: check cache
uses: actions/cache@v4
id: check_cache
with:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}
restore-keys: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}
lookup-only: true
- name: Install Qt
if: steps.check_cache.outputs.cache-hit != 'true' || github.event_name == 'schedule'
uses: jurplel/install-qt-action@v4
with:
cache: true
version: "6.2.*"
- name: conan detect profile
if: steps.check_cache.outputs.cache-hit != 'true' || github.event_name == 'schedule'
run: |
conan profile detect --force
- name: Run CMake
if: steps.check_cache.outputs.cache-hit != 'true' || github.event_name == 'schedule'
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.config.name }}-tests
configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=${{ matrix.build_type.config }}', '-DCMAKE_CONFIGURATION_TYPES=${{ matrix.build_type.config }}']"
sanitize:
needs: ["cache_deps"]
strategy:
matrix:
sanitizer: ["tsan", "asan", "lsan", "ubsan"]
name: Sanitize - ${{ matrix.sanitizer }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Work around https://github.com/actions/runner-images/issues/8659
# - name: "Remove GCC 13 from runner image (workaround)"
# shell: bash
# run: |
# sudo apt-get update
# sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev
# sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.*
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
cache: true
version: "6.2.*"
- name: get conan
uses: turtlebrowser/get-conan@main
- name: cache deps
uses: actions/cache@v4
with:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}
restore-keys: deps-ci-ubuntu-clang-Release
- name: conan detect profile
run: |
conan profile detect --force
- shell: bash
run: |
# GH-40558: reduce ASLR to avoid ASAN/LSAN crashes
sudo sysctl -w vm.mmap_rnd_bits=28
- name: Run CMake
uses: lukka/run-cmake@v10
with:
configurePreset: ci-sanitize-${{ matrix.sanitizer }}
buildPreset: ci-build
testPreset: ci-sanitize
tests:
needs: ["cache_deps"]
strategy:
matrix:
config: [{name: ci-ubuntu-gcc, os: ubuntu-latest},
{name: ci-ubuntu-clang, os: ubuntu-latest},
{name: ci-windows, os: windows-latest},
{name: ci-macos, os: macos-latest}]
type: [tests, benchmarks]
build_type: [{config: Release, test_preset: ci-tests}, {config: Debug, test_preset: ci-tests-debug}]
optimization_disabled: [{mode: 0, postfix: ""}, {mode: 1, postfix: " (Optimizations disabled)"}]
timeout-minutes: 20
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.type }} ${{ matrix.config.name }} ${{ matrix.build_type.config }}${{ matrix.optimization_disabled.postfix}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Work around https://github.com/actions/runner-images/issues/8659
# - name: "Remove GCC 13 from runner image (workaround)"
# if: matrix.config.os == 'ubuntu-latest'
# shell: bash
# run: |
# sudo apt-get update
# sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev
# sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.*
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.type }}-${{ matrix.config.name }}-${{ matrix.build_type.config }}
- name: Install deps
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update -q && sudo apt-get install clang-tidy cppcheck -y -q
pip install pyyaml
- name: Cmake version
run: cmake --version
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
cache: true
version: "6.2.*"
- name: get conan
uses: turtlebrowser/get-conan@main
- name: cache deps
uses: actions/cache@v4
with:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}
restore-keys: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}
- name: conan detect profile
run: |
conan profile detect --force
- name: Run CMake
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.config.name }}-${{ matrix.type }}
configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=${{ matrix.build_type.config }}', '-DCMAKE_CONFIGURATION_TYPES=${{ matrix.build_type.config }}', '-DRPP_DISABLE_DISPOSABLES_OPTIMIZATION=${{matrix.optimization_disabled.mode}}']"
buildPreset: ci-build
buildPresetAdditionalArgs: "['--config ${{ matrix.build_type.config }}']"
testPreset: ${{matrix.build_type.test_preset}}
- name: Upload benchmark results
uses: actions/upload-artifact@v4
if: matrix.type == 'benchmarks' && matrix.build_type.config == 'Release'
with:
name: ${{ matrix.config.name }}${{ matrix.optimization_disabled.postfix}}
path: ${{github.workspace}}/build/test_results/benchmarks_results.json
docs:
name: Build Doxygen Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with: { python-version: "3.8" }
- uses: ssciwr/doxygen-install@v1
- name: Install deps
run: |
pip3 install rxmarbles
sudo apt-get update && sudo apt-get install texlive-font-utils
doxygen --version
- name: Doxygen
run: doxygen
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: github.event_name == 'push' && github.repository_owner == 'victimsnino'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gen_docs
destination_dir: v2/docs
use_rpp_as_package:
timeout-minutes: 20
runs-on: ubuntu-latest
name: Test RPP as package - ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
cache: true
version: "6.2.*"
- name: Install project and build
env:
CC: gcc-10
CXX: g++-10
run: |
cmake -B build
sudo cmake --build build --target install --parallel 2 --config Release
cmake -B sample_build -S src/examples/rpp/package
cmake --build sample_build --parallel 2 --config Release
# cmake -B qt_sample_build -S src/examples/rppqt/package
# cmake --build qt_sample_build --parallel 2 --config Release