-
Notifications
You must be signed in to change notification settings - Fork 141
322 lines (316 loc) · 12.9 KB
/
Copy pathci.yml
File metadata and controls
322 lines (316 loc) · 12.9 KB
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
name: Integration tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
schedule:
- cron: '38 2 * * *'
jobs:
ubuntu_build:
name: ubuntu_build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install build-tools
run: sudo apt-get update && sudo apt-get install -y build-essential cmake python3-pandas python3-lxml
- name: configure
run: >
mkdir build &&
cd build &&
cmake ..
-DBUILDING_TESTS=1
-DINTEGRATION_TESTS=1
-DWITH_ASAN=ON
-DPRIMARY_CLIENT_STRICT_PARSING_=ON
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DCHECK_RTDE_DOCS_RECIPE=ON
env:
CXXFLAGS: -g -O2 -fprofile-arcs -ftest-coverage
CFLAGS: -g -O2 -fprofile-arcs -ftest-coverage
LDFLAGS: -fprofile-arcs -ftest-coverage
- name: build
id: build
run: cmake --build build --config Debug
- name: Archive CMake build directory
if: steps.build.outcome == 'success'
run: tar -czf build.tar.gz build
- name: Upload CMake build archive
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v7
with:
path: build.tar.gz
if-no-files-found: error
retention-days: 5
archive: false
run_tests:
timeout-minutes: 60
runs-on: ubuntu-latest
name: run_tests (${{matrix.env.URSIM_VERSION}}-${{matrix.env.ROBOT_MODEL}})
needs: ubuntu_build
strategy:
fail-fast: false
matrix:
env:
- ROBOT_MODEL: 'ur5'
URSIM_VERSION: '3.14.3'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/cb3'
- ROBOT_MODEL: 'ur5e'
URSIM_VERSION: '5.9.4'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur20'
URSIM_VERSION: 'latest'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur5e'
URSIM_VERSION: '10.7.0'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur5e'
URSIM_VERSION: '10.11.0'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur5e'
URSIM_VERSION: '10.12.0'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
steps:
- uses: actions/checkout@v6
- name: start ursim
run: |
scripts/start_ursim.sh -m $ROBOT_MODEL -v $URSIM_VERSION -p $PROGRAM_FOLDER -d -f DISABLED
env:
DOCKER_RUN_OPTS: --network ursim_net
ROBOT_MODEL: ${{matrix.env.ROBOT_MODEL}}
URSIM_VERSION: ${{matrix.env.URSIM_VERSION}}
PROGRAM_FOLDER: ${{matrix.env.PROGRAM_FOLDER}}
- id: check_polyscopex
run: |
if [[ "${{matrix.env.URSIM_VERSION}}" == "10."* ]]; then
echo "is_polyscopex=true" >> $GITHUB_OUTPUT
else
echo "is_polyscopex=false" >> $GITHUB_OUTPUT
fi
- name: setup chrome
uses: browser-actions/setup-chrome@v2
- name: Download CMake build archive
uses: actions/download-artifact@v8
with:
name: build.tar.gz
- name: Extract CMake build directory
run: tar -xzf build.tar.gz
- name: Create folder for test artifacts
run: mkdir -p test_artifacts
- name: Access PolyScope
if: ${{ steps.check_polyscopex.outputs.is_polyscopex == 'true' }}
run: chrome --no-sandbox --disable-settuid-sandbox --headless=new 192.168.56.101 &
- name: Install Python dependencies
run: sudo apt-get update && sudo apt-get install -y python3-pandas python3-lxml
- name: Generate rtde outputs lists
run: python3 tests/resources/generate_rtde_outputs.py
- name: test
run: cd build && ctest --output-on-failure --output-junit junit.xml
env:
URSIM_VERSION: ${{matrix.env.URSIM_VERSION}}
- name: Upload test results to Codecov
uses: codecov/codecov-action@v7
with:
fail_ci_if_error: true
files: build/junit.xml
report_type: test_results
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: run examples
run: ./run_examples.sh "192.168.56.101" 1
- name: install gcovr
run: sudo apt-get install -y gcovr
- name: gcovr
run: cd build && gcovr -r .. --xml coverage.xml --gcov-ignore-parse-errors negative_hits.warn_once_per_file --exclude "../3rdparty"
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v7
with:
fail_ci_if_error: true
files: build/coverage.xml
flags: ${{ matrix.env.ROBOT_MODEL }}-${{ matrix.env.URSIM_VERSION }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Generate URSim log files
if: ${{ always() && steps.check_polyscopex.outputs.is_polyscopex == 'false' }}
run: |
nc -q 1 192.168.56.101 29999 <<END
saveLog
END
mkdir -p ursim_logs
docker cp ursim:/ursim/URControl.log ursim_logs/URControl.log
docker cp ursim:/ursim/polyscope.log ursim_logs/polyscope.log
docker cp ursim:/ursim/log_history.txt ursim_logs/log_history.txt
- name: Copy flight reports
if: ${{ failure() && steps.check_polyscopex.outputs.is_polyscopex == 'false' }}
run: |
mkdir -p ursim_logs/flightreports
docker cp ursim:/ursim/flightreports/. ursim_logs/flightreports/
- name: Upload logfiles
uses: actions/upload-artifact@v7
if: ${{ always() && steps.check_polyscopex.outputs.is_polyscopex == 'false' }}
with:
name: ${{matrix.env.ROBOT_MODEL}}_${{matrix.env.URSIM_VERSION}}_URSim_Logs
path: ursim_logs
if-no-files-found: error
retention-days: 10
- name: Upload test artifacts
uses: actions/upload-artifact@v7
if: ${{ always() && steps.check_polyscopex.outputs.is_polyscopex == 'false' }}
with:
name: ${{matrix.env.ROBOT_MODEL}}_${{matrix.env.URSIM_VERSION}}_test_artifacts
path: test_artifacts
if-no-files-found: error
retention-days: 10
- name: Upload generated scripts
uses: actions/upload-artifact@v6
if: ${{ always() }}
with:
name: ${{matrix.env.ROBOT_MODEL}}_${{matrix.env.URSIM_VERSION}}_generated_scripts
path: test_artifacts/generated_scripts
if-no-files-found: warn
retention-days: 10
robot_model_check:
timeout-minutes: 60
runs-on: ubuntu-latest
needs: ubuntu_build
name: check_model (${{matrix.env.URSIM_VERSION}}-${{matrix.env.ROBOT_MODEL}})
strategy:
fail-fast: false
matrix:
env:
- ROBOT_MODEL: 'ur3'
URSIM_VERSION: '3.14.3'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/cb3'
- ROBOT_MODEL: 'ur5'
URSIM_VERSION: '3.15.8'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/cb3'
- ROBOT_MODEL: 'ur10'
URSIM_VERSION: '3.15.8'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/cb3'
- ROBOT_MODEL: 'ur3e'
URSIM_VERSION: '5.9.4'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur5e'
URSIM_VERSION: '5.12.8'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur7e'
URSIM_VERSION: '5.22.2'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur10e'
URSIM_VERSION: '5.15.2'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur12e'
URSIM_VERSION: '5.25.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur16e'
URSIM_VERSION: '5.25.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur8long'
URSIM_VERSION: '5.25.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur15'
URSIM_VERSION: '5.25.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur18'
URSIM_VERSION: '5.25.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur20'
URSIM_VERSION: '5.25.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur30'
URSIM_VERSION: '5.25.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- ROBOT_MODEL: 'ur3e'
URSIM_VERSION: '10.11.0'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur5e'
URSIM_VERSION: '10.11.0'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur7e'
URSIM_VERSION: '10.11.0'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur10e'
URSIM_VERSION: '10.11.0'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur12e'
URSIM_VERSION: '10.12.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur16e'
URSIM_VERSION: '10.12.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur8long'
URSIM_VERSION: '10.12.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur15'
URSIM_VERSION: '10.12.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur18'
URSIM_VERSION: '10.12.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur20'
URSIM_VERSION: '10.12.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
- ROBOT_MODEL: 'ur30'
URSIM_VERSION: '10.12.1'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/polyscopex'
steps:
- uses: actions/checkout@v6
- name: start ursim
run: |
scripts/start_ursim.sh -m $ROBOT_MODEL -v $URSIM_VERSION -p $PROGRAM_FOLDER -d -f DISABLED
env:
DOCKER_RUN_OPTS: --network ursim_net
ROBOT_MODEL: ${{matrix.env.ROBOT_MODEL}}
URSIM_VERSION: ${{matrix.env.URSIM_VERSION}}
PROGRAM_FOLDER: ${{matrix.env.PROGRAM_FOLDER}}
- name: Download CMake build archive
uses: actions/download-artifact@v8
with:
name: build.tar.gz
- name: Extract CMake build directory
run: tar -xzf build.tar.gz
- name: inspect build folder
run: ls -la build && ls -la build/tests
- name: test robot type
run: cd build && ctest -R PrimaryClientTest.test_robot_type --verbose --output-junit junit.xml
env:
URSIM_VERSION: ${{matrix.env.URSIM_VERSION}}
ROBOT_MODEL: ${{matrix.env.ROBOT_MODEL}}
- name: install gcovr
run: sudo apt-get install -y gcovr
- name: gcovr
run: cd build && gcovr -r .. --xml coverage.xml --gcov-ignore-parse-errors negative_hits.warn_once_per_file --exclude "../3rdparty"
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v7
with:
fail_ci_if_error: true
files: build/coverage.xml
flags: check_version_${{ matrix.env.ROBOT_MODEL }}-${{ matrix.env.URSIM_VERSION }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test_start_ursim:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3' # Not needed with a .ruby-version, .tool-versions or mise.toml
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup Bats and bats libs
id: setup-bats
uses: bats-core/bats-action@4.0.0
- name: Install Ruby dependencies
run: bundle update --bundler && bundle install
- name: Run unittests
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
run: bundle exec bashcov --skip-uncovered bats tests/test_start_ursim.bats
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v7
with:
fail_ci_if_error: true
flags: start_ursim
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}