forked from ApexAI/apex_rostest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
197 lines (186 loc) · 4.93 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
189
190
191
192
193
194
195
196
197
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:
- echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list
- curl http://repo.ros2.org/repos.key | apt-key add -
- apt-get update
- apt-get install -y python3-colcon-common-extensions
- source /opt/ros/crystal/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 && apt-get install -y
build-essential
cmake
git
python3-colcon-common-extensions
python3-pip
python-rosdep
python3-vcstool
wget
- 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/[email protected]
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 crystal
-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 apex_launchtest apex_launchtest_cmake
artifacts:
paths:
- build
- install
build_all:
<<: *bin_job_template
stage: build
script:
- colcon build --symlink-install
artifacts:
paths:
- build
- install
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 apex_launchtest
- colcon list --topological-graph --packages-up-to apex_launchtest
- colcon list --topological-graph --packages-up-to apex_launchtest | grep "rclpy" &> /dev/null && exit 1 # Fail if apex_launchtest depends on rclpy
- colcon build --packages-up-to apex_launchtest
- 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 apex_launchtest_ros
- colcon build --packages-up-to apex_launchtest_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 apex_launchtest apex_launchtest_cmake
- 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"
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 apex_launchtest --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 apex_launchtest_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