-
Notifications
You must be signed in to change notification settings - Fork 53
600 lines (565 loc) · 27.3 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
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
name: "Test action-ros-ci"
on:
pull_request:
push:
branches:
- master
- "releases/*"
schedule:
# Run the CI automatically twice per day to look for flakyness.
- cron: "0 */12 * * *"
defaults:
run:
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
pre_condition:
name: "Don't run scheduled jobs on forks"
runs-on: ubuntu-latest
if: ${{ (github.event_name != 'schedule') || (github.event_name == 'schedule' && github.repository == 'ros-tooling/action-ros-ci') }}
steps:
- run: 'true'
test_ros:
name: "Test ROS package"
runs-on: ubuntu-latest
needs: pre_condition
strategy:
fail-fast: false
matrix:
ros_distribution: # ROS 1 tests only run on Ubuntu
- noetic
# Define the Docker image(s) associated with each ROS distribution.
# The include syntax allows additional variables to be defined, like
# docker_image in this case. See documentation:
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build
#
# Platforms are defined in REP 3: https://ros.org/reps/rep-0003.html
include:
# Noetic Ninjemys (May 2020 - May 2025)
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-noetic-ros-base-latest
ros_distribution: noetic
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: "20.x"
- run: .github/workflows/build-and-test.sh
- uses: ./
id: action-ros-ci
with:
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/ros_tutorials.repos"
package-name: roscpp_tutorials
target-ros1-distro: ${{ matrix.ros_distribution }}
- run: test -d "${{ steps.action-ros-ci.outputs.ros-workspace-directory-name }}/install/roscpp_tutorials"
name: "Check that roscpp_tutorials install directory is present"
test_ros2:
name: "Test ROS 2 packages in repository"
runs-on: ${{ matrix.os }}
needs: pre_condition
strategy:
fail-fast: false
matrix:
os: [macOS-latest, windows-2019]
ros_distribution: [humble, iron, jazzy]
env:
INSTALL_TYPE: ${{ matrix.os == 'windows-2019' && 'merged' || 'default' }}
INSTALL_PATH: ${{ matrix.os == 'windows-2019' && 'install/share' || 'install' }}
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: "20.x"
- run: .github/workflows/build-and-test.sh
- uses: ros-tooling/setup-ros@master
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
- uses: ./
id: test_all_packages_in_repo
name: "Test all packages in single repo, default options"
with:
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_cpp_package.repos"
- name: "Check that osrf_testing_tools_cpp install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_all_packages_in_repo.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/osrf_testing_tools_cpp"
- name: "Check that test_osrf_testing_tools_cpp install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_all_packages_in_repo.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/test_osrf_testing_tools_cpp"
test_ros2_humble_package_with_dependencies:
name: "Test ROS 2 humble package with ROS dependencies"
runs-on: ubuntu-22.04
needs: pre_condition
steps:
- uses: actions/checkout@v4
- uses: ros-tooling/setup-ros@master
with:
required-ros-distributions: humble
- uses: ./
with:
package-name: rmw
target-ros2-distro: humble
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_cpp_with_dependency.repos"
test_ros2_humble_rosdep_skip_keys:
name: "Test with rosdep-skip-keys option"
runs-on: ubuntu-22.04
needs: pre_condition
steps:
- uses: actions/checkout@v4
- uses: ros-tooling/setup-ros@master
with:
required-ros-distributions: humble
# Skip installing test_depend dependency and verifies it isn't installed.
- uses: ./
with:
package-name: rmw
target-ros2-distro: humble
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_cpp_with_dependency.repos"
extra-cmake-args: -DBUILD_TESTING=Off
skip-tests: true
rosdep-skip-keys: osrf_testing_tools_cpp
- name: Install dpkg
run: sudo apt -y install dpkg
- name: "Verify dependencies were skipped"
run: |
[[ $(dpkg -s ros-humble-osrf-testing-tools-cpp) -eq 0 ]]
# Install dependencies as usual and verifies it is now installed.
- uses: ./
with:
package-name: rmw
target-ros2-distro: humble
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_cpp_with_dependency.repos"
- name: "Verify dependencies weren't skipped"
run: |
dpkg -s ros-humble-osrf-testing-tools-cpp
test_ros2_iron_skip_rosdep_install:
name: Test rosdep check/skip install options
runs-on: ubuntu-22.04
needs: pre_condition
container:
image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
target-ros2-distro: iron
package-name: ament_copyright
vcs-repo-file-url: "https://raw.githubusercontent.com/ros2/ros2/release-iron-20240209/ros2.repos"
skip-rosdep-install: true
rosdep-check: true
test_private_repo:
name: "Test with private repos"
runs-on: ubuntu-22.04
needs: pre_condition
# We don't have access to the secret token for the test repo on a fork
if: ${{ !github.event.repository.fork && !github.event.pull_request.head.repo.fork }}
steps:
- uses: actions/checkout@v4
- uses: ros-tooling/setup-ros@master
with:
required-ros-distributions: humble
- uses: ./
with:
import-token: ${{ secrets.TOKEN_PRIVATE_REPO_TEST }}
package-name: simple_package
target-ros2-distro: humble
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_private_repo.repos"
test_ros2_docker:
name: "ROS 2 Docker"
runs-on: ubuntu-latest
needs: pre_condition
strategy:
fail-fast: false
matrix:
ros_distribution:
- humble
- iron
- jazzy
- rolling
# Define the Docker image(s) associated with each ROS distribution.
# The include syntax allows additional variables to be defined, like
# docker_image in this case. See documentation:
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build
#
# Platforms are defined in REP 2000: https://ros.org/reps/rep-2000.html
include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
ros_distribution: humble
# Iron Irwini (May 2023 - November 2024)
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest
ros_distribution: iron
# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
ros_distribution: jazzy
# Rolling Ridley (see REP 2002: https://www.ros.org/reps/rep-2002.html)
- docker_image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest
ros_distribution: rolling
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: "20.x"
- run: .github/workflows/build-and-test.sh
- uses: ./
name: "Test rosdep installs from correct distro"
with:
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: .github/workflows/repo_file_for_test_rosdep_distro.repos
# test_msgs depends on test_interface_files, which should be installed by rosdep
# If the dependencies are installed for the wrong distribution, then the build should fail
package-name: test_msgs
# Verify that rosdep installed the required Debian package
- run: dpkg -s ros-${{ matrix.ros_distribution }}-test-interface-files
- uses: ./
id: test_all_packages_in_repo
name: "Test all packages in repo, default options"
with:
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_cpp_package.repos"
- run: test -d "${{ steps.test_all_packages_in_repo.outputs.ros-workspace-directory-name }}/install/osrf_testing_tools_cpp"
- run: test -d "${{ steps.test_all_packages_in_repo.outputs.ros-workspace-directory-name }}/install/test_osrf_testing_tools_cpp"
test_ros2_from_source:
name: "ROS 2 from source"
runs-on: ${{ startsWith(matrix.os, 'ubuntu') && 'ubuntu-latest' || matrix.os }}
needs: pre_condition
container:
image: ${{ startsWith(matrix.os, 'ubuntu') && matrix.os || '' }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu:22.04
ros_distribution: humble
- os: ubuntu:22.04
ros_distribution: iron
- os: ubuntu:24.04
ros_distribution: jazzy
- os: ubuntu:24.04
ros_distribution: rolling
- os: windows-2019
ros_distribution: humble
- os: windows-2019
ros_distribution: iron
- os: windows-2019
ros_distribution: jazzy
- os: windows-2019
ros_distribution: rolling
- os: macOS-latest
ros_distribution: humble
- os: macOS-latest
ros_distribution: iron
- os: macOS-latest
ros_distribution: jazzy
- os: macOS-latest
ros_distribution: rolling
env:
DISTRO_REPOS_URL: "https://raw.githubusercontent.com/ros2/ros2/${{ matrix.ros_distribution }}/ros2.repos"
INSTALL_TYPE: ${{ matrix.os == 'windows-2019' && 'merged' || 'default' }}
INSTALL_PATH: ${{ matrix.os == 'windows-2019' && 'install/share' || 'install' }}
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: "20.x"
- run: .github/workflows/build-and-test.sh
- uses: ros-tooling/setup-ros@master
- uses: ./
id: test_single_package
name: "Test single package, default options"
with:
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ env.DISTRO_REPOS_URL }}
- name: "Check that ament_copyright install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_single_package.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/ament_copyright"
- uses: ./
id: test_multiple_packages
name: "Test multiple package, default options"
with:
package-name: ament_copyright ament_lint
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ env.DISTRO_REPOS_URL }}
- name: "Check that ament_copyright install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_multiple_packages.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/ament_copyright"
- name: "Check that ament_lint install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_multiple_packages.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/ament_lint"
- uses: ./
id: test_connext_dependency
name: "Test single package with Connext dependency, default options"
if: startsWith(matrix.os, 'ubuntu-')
with:
package-name: rmw_implementation
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ env.DISTRO_REPOS_URL }}
- run: test -d "${{ steps.test_connext_dependency.outputs.ros-workspace-directory-name }}/install/rmw_implementation"
name: "Check that rmw_implementation install directory is present"
if: startsWith(matrix.os, 'ubuntu-')
- uses: ./
id: test_mixin
name: "Test single package, with custom mixin"
with:
colcon-defaults: |
{
"build": {
"mixin": ["asan-gcc"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ env.DISTRO_REPOS_URL }}
- name: "Check that ament_copyright install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_mixin.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/ament_copyright"
- uses: ./
id: test_repo
name: "Test single package, with custom repository file"
with:
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test${{ matrix.os == 'ubuntu:24.04' && '_noble' || '' }}.repos"
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
- name: "Check that ament_copyright install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_repo.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/ament_copyright"
- uses: ./
id: test_colcon_defaults
name: "Test single package, with colcon defaults"
with:
colcon-defaults: |
{
"build": {
"build-base": "build-custom"
}
}
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ env.DISTRO_REPOS_URL }}
- name: "Check that ament_copyright install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_colcon_defaults.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/ament_copyright"
- run: test -d "${{ steps.test_colcon_defaults.outputs.ros-workspace-directory-name }}/build-custom"
# The second repo file is ignored, but will get vcs-import'ed anyway.
# This test case just run basic testing on the action logic, making
# sure the for-loop is implemented correctly.
- uses: ./
id: test_multiple_repos
name: "Test single package, with multiple custom repository files"
with:
vcs-repo-file-url: |
.github/workflows/repo_file_for_test${{ matrix.os == 'ubuntu:24.04' && '_noble' || '' }}.repos
.github/workflows/repo_file_for_test_cpp_package.repos
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
- name: "Check that ament_copyright install directory is present in ${{ env.INSTALL_TYPE }} install space"
run: test -d "${{ steps.test_multiple_repos.outputs.ros-workspace-directory-name }}/${{ env.INSTALL_PATH }}/ament_copyright"
- run: test -d "${{ steps.test_multiple_repos.outputs.ros-workspace-directory-name }}/src/ament_lint"
- run: test -d "${{ steps.test_multiple_repos.outputs.ros-workspace-directory-name }}/src/osrf_testing_tools_cpp"
- uses: ./
id: test_coverage
name: "Test single package, with coverage enabled (Linux only)"
with:
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
package-name: osrf_testing_tools_cpp
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_cpp_package.repos"
if: runner.os != 'Windows'
- run: find ${{ steps.test_coverage.outputs.ros-workspace-directory-name }}/build -name "*.gcda" | grep -q "."
name: "Check if one or more code coverage files (*.gcda) are present (Linux only)"
if: runner.os != 'Windows'
- uses: ./
id: test_extra_cmake
name: "Test single package, with extra cmake flags"
with:
package-name: ament_cmake_core
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test${{ matrix.os == 'ubuntu:24.04' && '_noble' || '' }}.repos"
# We use a long unique string here to make sure that if this string
# is found in CMakeCache.txt, it means the additional CMake flag has
# been passed successfully. Non recognized flags are also written by
# cmake into CMakeCache.txt, so this does not need to be a flag that
# really exists in this package.
extra-cmake-args: |
-DADDITIONAL_CMAKE_OPTION_FOR_TEST:STR="9ae391a63628efe6d72ba34a1a1d9dc9"
- run: grep -q 9ae391a63628efe6d72ba34a1a1d9dc9 ./${{ steps.test_extra_cmake.outputs.ros-workspace-directory-name }}/build/ament_cmake_core/CMakeCache.txt
name: "Check that the additional extra flags has been correctly passed"
- uses: ./
id: test_skip_tests
name: "Test single package, skip tests"
with:
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ env.DISTRO_REPOS_URL }}
skip-tests: true
- run: test -d "${{ steps.test_skip_tests.outputs.ros-workspace-directory-name }}/build/ament_copyright"
name: "Check that a build directory exists for ament_copyright"
- run: test ! -f "${{ steps.test_skip_tests.outputs.ros-workspace-directory-name }}/build/ament_copyright/colcon_test.rc"
name: "Check that 'colcon test' wasn't run on ament_copyright"
- uses: ./
id: test_no_symlink_install
name: "Test single package, with no --symlink-install"
with:
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ env.DISTRO_REPOS_URL }}
no-symlink-install: true
- run: test ! -f "${{ steps.test_no_symlink_install.outputs.ros-workspace-directory-name }}/install/ament_copyright/lib/python3.*/site-packages/ament-copyright.egg-link"
name: "Check that an .egg-link file in the install dir does not exist for ament_copyright"
test_ros2_from_source_docker:
name: "Test ROS 2 from source Docker"
runs-on: ubuntu-latest
needs: pre_condition
strategy:
fail-fast: false
matrix:
ros_distribution:
- humble
- iron
- jazzy
- rolling
# Define the Docker image(s) associated with each ROS distribution.
# The include syntax allows additional variables to be defined, like
# docker_image in this case. See documentation:
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build
#
# Platforms are defined in REP 2000: https://ros.org/reps/rep-2000.html
include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: ubuntu:jammy
ros_distribution: humble
distro_repos_url: https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos
# Iron Irwini (May 2023 - November 2024)
- docker_image: ubuntu:jammy
ros_distribution: iron
distro_repos_url: https://raw.githubusercontent.com/ros2/ros2/iron/ros2.repos
# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
distro_repos_url: https://raw.githubusercontent.com/ros2/ros2/jazzy/ros2.repos
# Rolling Ridley (see REP 2002: https://www.ros.org/reps/rep-2002.html)
- docker_image: ubuntu:noble
ros_distribution: rolling
distro_repos_url: https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: "20.x"
- run: .github/workflows/build-and-test.sh
- uses: ros-tooling/setup-ros@master
- uses: ./
id: test_single_package
name: "Test single package, default options"
with:
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ matrix.distro_repos_url }}
- run: test -d "${{ steps.test_single_package.outputs.ros-workspace-directory-name }}/install/ament_copyright"
name: "Check that ament_copyright install directory is present"
- uses: ./
id: test_multiple_packages
name: "Test multiple package, default options"
with:
package-name: ament_copyright ament_lint
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ matrix.distro_repos_url }}
- run: test -d "${{ steps.test_multiple_packages.outputs.ros-workspace-directory-name }}/install/ament_copyright"
name: "Check that ament_copyright install directory is present"
- run: test -d "${{ steps.test_multiple_packages.outputs.ros-workspace-directory-name }}/install/ament_lint"
name: "Check that ament_lint install directory is present"
- uses: ./
id: test_connext_dependency
name: "Test single package with Connext dependency, default options"
with:
package-name: rmw_implementation
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ matrix.distro_repos_url }}
- run: test -d "${{ steps.test_connext_dependency.outputs.ros-workspace-directory-name }}/install/rmw_implementation"
name: "Check that rmw_implementation install directory is present"
- uses: ./
id: test_mixin
name: "Test single package, with custom mixin"
with:
colcon-defaults: |
{
"build": {
"mixin": ["asan-gcc"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ matrix.distro_repos_url }}
- run: test -d "${{ steps.test_mixin.outputs.ros-workspace-directory-name }}/install/ament_copyright"
name: "Check that ament_copyright install directory is present"
- uses: ./
id: test_repo
name: "Test single package, with custom repository file"
with:
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test${{ matrix.os == 'ubuntu:24.04' && '_noble' || '' }}.repos"
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
- run: test -d "${{ steps.test_repo.outputs.ros-workspace-directory-name }}/install/ament_copyright"
# The second repo file is ignored, but will get vcs-import'ed anyway.
# This test case just run basic testing on the action logic, making
# sure the for-loop is implemented correctly.
- uses: ./
id: test_multiple_repos
name: "Test single package, with multiple custom repository files"
with:
vcs-repo-file-url: |
.github/workflows/repo_file_for_test${{ matrix.os == 'ubuntu:24.04' && '_noble' || '' }}.repos
.github/workflows/repo_file_for_test_cpp_package.repos
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
- run: test -d "${{ steps.test_multiple_repos.outputs.ros-workspace-directory-name }}/install/ament_copyright"
- run: test -d "${{ steps.test_multiple_repos.outputs.ros-workspace-directory-name }}/src/ament_lint"
- run: test -d "${{ steps.test_multiple_repos.outputs.ros-workspace-directory-name }}/src/osrf_testing_tools_cpp"
- uses: ./
id: test_coverage
name: "Test single package, with coverage enabled (Linux only)"
with:
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
package-name: osrf_testing_tools_cpp
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_cpp_package.repos"
- run: find ${{ steps.test_coverage.outputs.ros-workspace-directory-name }}/build -name "*.gcda" | grep -q "."
name: "Check if one or more code coverage files (*.gcda) are present (Linux only)"
- uses: ./
id: test_extra_cmake
name: "Test single package, with extra cmake flags"
with:
package-name: ament_cmake_core
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test${{ matrix.os == 'ubuntu:24.04' && '_noble' || '' }}.repos"
# We use a long unique string here to make sure that if this string
# is found in CMakeCache.txt, it means the additional CMake flag has
# been passed successfully. Non recognized flags are also written by
# cmake into CMakeCache.txt, so this does not need to be a flag that
# really exists in this package.
extra-cmake-args: |
-DADDITIONAL_CMAKE_OPTION_FOR_TEST:STR="9ae391a63628efe6d72ba34a1a1d9dc9"
- run: grep -q 9ae391a63628efe6d72ba34a1a1d9dc9 ./${{ steps.test_extra_cmake.outputs.ros-workspace-directory-name }}/build/ament_cmake_core/CMakeCache.txt
name: "Check that the additional extra flags has been correctly passed"
- uses: ./
id: test_directories_with_same_name_as_repo
name: "Test that directories with the same name as this repository are not removed"
with:
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/repo_file_for_test_dirs_with_same_name_as_repo${{ matrix.os == 'ubuntu:24.04' && '_noble' || '' }}.repos"
- run: test -d "${{ steps.test_directories_with_same_name_as_repo.outputs.ros-workspace-directory-name }}/src/action-ros-ci/foo"
- run: test -d "${{ steps.test_directories_with_same_name_as_repo.outputs.ros-workspace-directory-name }}/src/foo/action-ros-ci/bar"