This repository has been archived by the owner on Jan 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
188 lines (177 loc) · 4.69 KB
/
.gitlab-ci.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
stages:
- build
- test
- report
# Template for jobs that overlay on top of ROS binaries
.job_template: &bin_job_template
image: osrf/ros2:nightly
before_script:
- source /opt/ros/dashing/setup.bash
# Template for jobs that want to build everything from source (much slower)
.job_template: &src_job_template
image:
name: osrf/ros2:nightly
entrypoint: [""]
before_script:
- apt-get update
- python3 -m pip install -U
argcomplete
flake8
flake8-blind-except
flake8-builtins
flake8-class-newline
flake8-comprehensions
flake8-deprecated
flake8-docstrings
flake8-import-order
flake8-quotes
git+https://github.com/lark-parser/lark.git@0.7d
pytest-repeat
pytest-rerunfailures
pytest
pytest-cov
pytest-runner
setuptools
- apt-get install --no-install-recommends -y
libasio-dev
libtinyxml2-dev
- mkdir upstream_src
- wget https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos
- vcs import upstream_src < ros2.repos
- rosdep update
- rosdep install
--from-paths upstream_src
--ignore-src
--rosdistro dashing
-y
--skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers"
build_launchtest:
<<: *bin_job_template
stage: build
script:
- colcon build --packages-up-to launch_testing
artifacts:
paths:
- build
- install
build_all:
<<: *bin_job_template
stage: build
script:
- colcon build --symlink-install
artifacts:
paths:
- build
- install
# We need some bug fixes in launch that are newer than crystal, or else the tests hang.
# disabling the crystal build. We're re-enable this for Dashing once it's out
.build_all_crystal:
<<: *bin_job_template
image: osrf/ros:crystal-desktop
stage: build
script:
- colcon build --symlink-install
artifacts:
paths:
- build
- install
# Build everything from source to make sure our package.xml deps are correct
build_isolated:
<<: *src_job_template
stage: build
only:
- schedules
script:
- env # For debugging
# Make sure we can build and test launch_testing
- colcon list --topological-graph --packages-up-to launch_testing
- colcon list --topological-graph --packages-up-to launch_testing | grep "rclpy" &> /dev/null && exit 1 # Fail if launch_testing depends on rclpy
- colcon build --packages-up-to launch_testing
- tar -cf launchtest_artifacts.tar build install
# Make sure we can also build and test apex_launchtest_ros
- colcon list --topological-graph --packages-up-to launch_testing_ros
- colcon build --packages-up-to launch_testing_ros
- tar -cf launchtest_ros_artifacts.tar build install
artifacts:
paths:
- launchtest_artifacts.tar
- launchtest_ros_artifacts.tar
test_launchtest:
<<: *bin_job_template
stage: test
dependencies:
- build_launchtest
script:
- pip3 install mock
- colcon test --packages-select launch_testing
- colcon test-result --verbose
artifacts:
when: always
paths:
- log
test_all:
<<: *bin_job_template
stage: test
dependencies:
- build_all
script:
- pip3 install mock
- colcon test --pytest-args "--cov"
- colcon test-result --verbose
artifacts:
when: always
paths:
- build
- install
- log
- "*/.coverage"
# Same as above - we need bug fixes newer than crystal - re-enable for Dashing once it's out
.test_all_crystal:
<<: *bin_job_template
image: osrf/ros:crystal-desktop
stage: test
dependencies:
- build_all_crystal
script:
- pip3 install mock
- colcon test
- colcon test-result --verbose
artifacts:
when: always
paths:
- log
test_isolated:
<<: *src_job_template
stage: test
only:
- schedules
dependencies:
- build_isolated
script:
- env # For debugging
- pip3 install mock
- tar xf launchtest_artifacts.tar -C .
- colcon test --packages-select launch_testing --pytest-args "-k not (test_flake8 or test_pep257)"
- colcon test-result --all --verbose
- tar xf launchtest_ros_artifacts.tar -C .
- colcon test --packages-select launch_testing_ros --pytest-args "-k not (test_flake8 or test_pep257)"
- colcon test-result --all --verbose
artifacts:
when: always
paths:
- log
coverage:
stage: report
image:
name: python:3.6
dependencies:
- test_all
script:
- pip3 install coverage
- find . -iname ".coverage" -exec coverage combine -a {} \;
- coverage report
- coverage html
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
artifacts:
paths:
- htmlcov