-
Notifications
You must be signed in to change notification settings - Fork 16
366 lines (345 loc) · 11.1 KB
/
main.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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
name: CI
on:
schedule:
- cron: "40 2 * * *"
push:
branches:
- "main"
tags:
- version-*
paths-ignore:
- "**/memilio-epidata/**"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths-ignore:
- "**/memilio-epidata/**"
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- uses: pre-commit/[email protected]
build-cpp-gcc_clang:
if: github.event.pull_request.draft == false
strategy:
matrix:
compiler: ["gcc", "clang"]
config: ["Debug", "Release"]
version: ["latest", "min"]
include:
- version: "latest"
os: "ubuntu-latest"
- version: "min"
os: "ubuntu-20.04"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-build
with:
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
version: ${{ matrix.version }}
coverage: ${{ (matrix.compiler == 'gcc' && matrix.config == 'Debug' && matrix.version == 'latest') && 'ON' || 'OFF' }} # `c && t || f` is (usually) equivalent to `c ? t : f`
sanitize-addr: ${{ (matrix.compiler == 'gcc' && matrix.config == 'Debug' && matrix.version == 'latest') && 'ON' || 'OFF' }}
sanitize-ub: ${{ (matrix.compiler == 'gcc' && matrix.config == 'Debug' && matrix.version == 'latest') && 'ON' || 'OFF' }}
build-cpp-gcc-no-optional-deps:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-build
with:
compiler: gcc
version: latest
config: Release
optional-dependencies: OFF
build-cpp-msvc:
if: github.event.pull_request.draft == false
strategy:
matrix:
config: ["Debug", "Release"]
version: ["latest", "min"]
include:
- version: "latest"
os: "windows-2022"
- version: "min"
os: "windows-2019"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/windows-build
with:
config: ${{ matrix.config }}
version: ${{ matrix.version }}
build-cpp-msvc-no-optional-deps:
if: github.event.pull_request.draft == false
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/windows-build
with:
config: Release
version: latest
optional-dependencies: OFF
test-cpp-gcc_clang:
if: github.event.pull_request.draft == false
needs: build-cpp-gcc_clang
strategy:
matrix:
compiler: ["gcc", "clang"]
config: ["Debug", "Release"]
version: ["latest", "min"]
include:
- version: "latest"
os: "ubuntu-latest"
- version: "min"
os: "ubuntu-20.04"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-test
with:
build-artifact: build-cpp-linux-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }}-full
coverage: ${{ (matrix.compiler == 'gcc' && matrix.version == 'latest' && matrix.config == 'Debug') && 'ON' || 'OFF' }}
test-linux-no-optional-deps:
if: github.event.pull_request.draft == false
needs: build-cpp-gcc-no-optional-deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-test
with:
build-artifact: build-cpp-linux-gcc-latest-Release-part
test-cpp-msvc:
if: github.event.pull_request.draft == false
needs: build-cpp-msvc
strategy:
matrix:
config: ["Debug", "Release"]
version: ["latest", "min"]
include:
- version: "latest"
os: "windows-2022"
- version: "min"
os: "windows-2019"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/windows-test
with:
build-artifact: build-cpp-windows-msvc-${{ matrix.version }}-${{ matrix.config }}-full
test-windows-no-optional-deps:
if: github.event.pull_request.draft == false
needs: build-cpp-msvc-no-optional-deps
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/windows-test
with:
build-artifact: build-cpp-windows-msvc-latest-Release-part
run_examples-cpp-gcc_clang:
if: github.event.pull_request.draft == false
needs: build-cpp-gcc_clang
strategy:
matrix:
compiler: ["gcc", "clang"]
config: ["Debug", "Release"]
version: ["latest", "min"]
include:
- version: "latest"
os: "ubuntu-latest"
- version: "min"
os: "ubuntu-20.04"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/linux-run_examples
with:
build-artifact: build-cpp-linux-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }}-full
run_examples-cpp-msvc:
if: github.event.pull_request.draft == false
needs: build-cpp-msvc
strategy:
matrix:
config: ["Debug", "Release"]
version: ["latest", "min"]
include:
- version: "latest"
os: "windows-2022"
- version: "min"
os: "windows-2019"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/windows-run_examples
with:
build-artifact: build-cpp-windows-msvc-${{ matrix.version }}-${{ matrix.config }}-full
build-py-generation:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-py
with:
package: generation
build-py-simulation:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-py
with:
package: simulation
build-py-surrogatemodel:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-py
with:
package: surrogatemodel
test-py-generation:
if: github.event.pull_request.draft == false
strategy:
matrix:
version: ["3.8", "3.11"]
needs: build-py-generation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test-py
with:
package: generation
test-py-simulation:
if: github.event.pull_request.draft == false
needs: build-py-simulation
strategy:
matrix:
version: ["3.8", "3.11"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test-py
with:
package: simulation
test-py-surrogatemodel:
if: github.event.pull_request.draft == false
needs: [build-py-surrogatemodel, build-py-simulation]
strategy:
matrix:
version: ["3.8", "3.11"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test-py
with:
package: surrogatemodel
coverage: ON
test-docs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test-docs
codecov:
if: github.event.pull_request.draft == false
needs: [test-cpp-gcc_clang, test-py-surrogatemodel]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get -qq -y install git curl
- name: Download python coverage report
uses: actions/download-artifact@v3
with:
name: test-py-coverage-reports-surrogatemodel
- name: Download cpp coverage report
uses: actions/download-artifact@v3
with:
name: test-cpp-coverage-reports
- name: Deploy to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage_python
files: ./coverage_python/**,./coverage.info
verbose: true
pages:
if: github.event.pull_request.draft == false
permissions:
contents: write
needs: [test-cpp-gcc_clang, test-docs, test-py-surrogatemodel]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get -qq -y install git
- name: Download python coverage report
uses: actions/download-artifact@v3
with:
name: test-py-coverage-reports-surrogatemodel
- name: Download cpp coverage report
uses: actions/download-artifact@v3
with:
name: test-cpp-coverage-reports
- name: Download pylint report
#if an error occurs here, the pylint report was not built, probably manually trigger epidata-ci
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: epidata_main.yml
name: pylint-report-epidata
path: pycode/build_pylint
- name: Download documentation
uses: actions/download-artifact@v3
with:
name: documentation
path: docs/html
- name: Prepare basic Pages sites
run: |
mkdir -p public
cp docs/style.css public/style.css
cp docs/index.html public/index.html
- name: Prepare pylint reports
run: |
mkdir -p public/pylint
cp pycode/build_pylint/pylint.html public/pylint/index.html
- name: Prepare documentation
run: |
mkdir -p public/documentation
cp -r docs/html/* public/documentation
- name: Prepare coverage reports
run: |
mkdir -p public/coverage
mkdir -p public/coverage/cpp
mkdir -p public/coverage/python
cp -r coverage_python/* public/coverage/python/
cp -r coverage/* public/coverage/cpp/
- name: Upload pages as artifact
uses: actions/upload-artifact@v3
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
with:
name: pages
path: public
if-no-files-found: error
retention-days: 1
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public