-
Notifications
You must be signed in to change notification settings - Fork 15
297 lines (243 loc) · 8.59 KB
/
test.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
# Main CI
# This is executed:
# - every PullRequest (new or update)
# - every merge in main
# - every night (05:00)
#
# These jobs that require to install eprosima libraries uses the artifact generated for eprosima-CI nightly
# so they do not have to compile the whole project. This saves huge amount of time.
#
# JOBS:
#
# - multiplatform-tests
# - [ ubuntu-22.04 | ubuntu-20.04 | windows-2019 | windows-2022 ]
# - [ Debug | Release ]
# - execute tests in different versions of ubuntu with different build types
#
# - asan
# - ubuntu-22.04
# - execute tests with ASAN flag
#
# - tsan
# - ubuntu-22.04
# - execute tests with TSAN flag
#
# - clang
# - ubuntu-22.04
# - execute clang-tidy check
#
# - coverage
# - ubuntu-22.04
# - execute test with coverage flag and upload results
#
# - flaky
# - ubuntu-22.04
# - execute flaky tests
#
# - docs
# - ubuntu-22.04
# - execute docs compile and tests
#
# - uncrustify
# - ubuntu-22.04
# - test uncrustify
#
# - python-linter
# - ubuntu-22.04
# - test python linter
#
# TODO: when merge CI in eprosima-CI repository, the jparisu fork must change for eProsima in actions.
#
# TODO: Add Windows CI
#
name: test
on:
workflow_dispatch:
inputs:
dependencies_artifact_postfix:
description: 'Postfix name to add to artifact name to download dependencies. This is use to download a specific artifact version from eProsima-CI.'
required: true
default: '_nightly'
pull_request:
push:
branches:
- main
schedule:
- cron: '0 5 * * *'
env:
# TODO: controller is not tested as it has no tests
code_packages_names: 'ddsrecorder_participants ddsrecorder_yaml ddsrecorder_tool ddsreplayer_tool'
docs_packages_names: 'ddsrecorder_docs'
default_dependencies_artifact_postfix: '_nightly'
jobs:
#####################################################################
# TEST
multiplatform-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cmake_build_type:
- Release
- Debug
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
- windows-2022
steps:
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src
- name: Download dependencies and install requirements
uses: ./src/.github/actions/project_dependencies
with:
os: ${{ matrix.os }}
cmake_build_type: ${{ matrix.cmake_build_type }}
dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }}
secret_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile and run tests
uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0
with:
packages_names: ${{ env.code_packages_names }}
cmake_args: -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
workspace_dependencies: './install'
ctest_args: --label-exclude "xfail"
colcon_meta_file: ./src/.github/workflows/configurations/${{ runner.os }}/colcon.meta
colcon_test_args: '--executor=sequential' # TODO remove when available in eProsima-CI
#####################################################################
# ASAN
asan:
runs-on: ubuntu-22.04
steps:
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src
- name: Download dependencies and install requirements
uses: ./src/.github/actions/project_dependencies
with:
os: ubuntu-22.04
cmake_build_type: Debug
dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }}
secret_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile and run tests
uses: eProsima/eProsima-CI/multiplatform/asan_build_test@v0
with:
packages_names: ${{ env.code_packages_names }}
workspace_dependencies: './install'
#####################################################################
# TSAN
tsan:
runs-on: ubuntu-22.04
steps:
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src
- name: Download dependencies and install requirements
uses: ./src/.github/actions/project_dependencies
with:
os: ubuntu-22.04
cmake_build_type: Debug
dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }}
secret_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile and run tests
uses: eProsima/eProsima-CI/multiplatform/tsan_build_test@v0
with:
packages_names: ${{ env.code_packages_names }}
workspace_dependencies: './install'
#####################################################################
# CLANG
clang:
runs-on: ubuntu-22.04
steps:
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src
- name: Download dependencies and install requirements
uses: ./src/.github/actions/project_dependencies
with:
os: ubuntu-22.04
cmake_build_type: Debug
dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }}
secret_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile and run tests
uses: eProsima/eProsima-CI/multiplatform/clang_build_test@v0
with:
packages_names: ${{ env.code_packages_names }}
workspace_dependencies: './install'
#####################################################################
# COVERAGE
coverage:
runs-on: ubuntu-22.04
environment:
name: codecov
steps:
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src
- name: Download dependencies and install requirements
uses: ./src/.github/actions/project_dependencies
with:
os: ubuntu-22.04
cmake_build_type: Release
dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }}
secret_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile and run tests
uses: eProsima/eProsima-CI/ubuntu/coverage_build_test_upload@v0
with:
packages_names: ${{ env.code_packages_names }}
workspace_dependencies: './install'
codecov_token: ${{ secrets.CODECOV_TOKEN }}
codecov_fix_file_path: ./src/codecov.yml
#####################################################################
# FLAKY
flaky:
runs-on: ubuntu-22.04
steps:
- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src
- name: Download dependencies and install requirements
uses: ./src/.github/actions/project_dependencies
with:
os: ubuntu-22.04
cmake_build_type: Release
dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }}
secret_token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile and run tests
uses: eProsima/eProsima-CI/multiplatform/colcon_build_test_flaky@v0
with:
packages_names: ${{ env.code_packages_names }}
workspace_dependencies: './install'
#####################################################################
# DOCUMENTATION TEST
docs:
runs-on: ubuntu-22.04
steps:
- name: Build and test documentation
uses: eProsima/eProsima-CI/ubuntu/sphinx_docs@main
with:
checkout_path: "${{ github.workspace }}/src/ddsrecordreplay"
path_to_requirements: "${{ github.workspace }}/src/ddsrecordreplay/docs/requirements.txt"
docs_subpackage_name: ${{ env.docs_packages_names }}
secret_token: ${{ secrets.GITHUB_TOKEN }}
#####################################################################
# UNCRUSTIFY
uncrustify:
runs-on: ubuntu-22.04
steps:
- name: Uncrustify
uses: eProsima/eProsima-CI/ubuntu/uncrustify@v0
#####################################################################
# PYTHON LINTER
python-linter:
runs-on: ubuntu-22.04
steps:
- name: Python Linter
uses: eProsima/eProsima-CI/ubuntu/python_linter@v0