-
Notifications
You must be signed in to change notification settings - Fork 18
226 lines (203 loc) · 8.41 KB
/
build-and-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
name: build-and-test
run-name: Build & test for ${{ github.ref_name }} on ${{ github.sha }}
on:
push:
branches:
- 'main'
- 'develop'
pull_request:
types: [opened, synchronize, reopened]
# Cancel previous runs if new changes on PR/branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
###### PREPARE WORKFLOW ######
checkout-repository:
runs-on: self-hosted
steps:
- name: Checkout repository code
uses: actions/checkout@v4
with:
clean: false
- name: Clean repository excluding RGL blobs repo
run: git clean -ffdx -e external/rgl_blobs
- name: Import private extensions
run: vcs import < extensions.repos
- name: Install taped test runtime dependencies
run: ./setup.py --fetch-rgl-blobs
load-env:
uses: ./.github/workflows/load-env-subworkflow.yml
###### BUILD USING RGL DOCKER ######
build-core:
needs: [checkout-repository, load-env]
runs-on: self-hosted
steps:
- run: '
docker build --build-context optix=${{ needs.load-env.outputs.optix-install-dir }}
--build-arg WITH_PCL=1 --build-arg WITH_ROS2=1
--build-arg BUILD_CMD="./setup.py"
--target=exporter --output=bin-core .'
build-pcl:
needs: [checkout-repository, load-env]
runs-on: self-hosted
steps:
- run: '
docker build --build-context optix=${{ needs.load-env.outputs.optix-install-dir }}
--build-arg WITH_PCL=1 --build-arg WITH_ROS2=1
--build-arg BUILD_CMD="./setup.py --with-pcl --build-taped-test"
--target=exporter --output=bin-pcl .'
build-ros2:
needs: [ checkout-repository, load-env ]
runs-on: self-hosted
steps:
- run: '
docker build --build-context optix=${{ needs.load-env.outputs.optix-install-dir }}
--build-arg WITH_PCL=1 --build-arg WITH_ROS2=1
--build-arg BUILD_CMD=". /opt/ros/\$ROS_DISTRO/setup.sh && ./setup.py --with-ros2-standalone"
--target=exporter --output=bin-ros2 .'
build-udp:
needs: [ checkout-repository, load-env ]
runs-on: self-hosted
steps:
- run: '
docker build --build-context optix=${{ needs.load-env.outputs.optix-install-dir }}
--build-arg WITH_PCL=1 --build-arg WITH_ROS2=1
--build-arg BUILD_CMD="./setup.py --with-udp"
--target=exporter --output=bin-udp .'
build-weather:
needs: [ checkout-repository, load-env ]
runs-on: self-hosted
steps:
- run: '
docker build --build-context optix=${{ needs.load-env.outputs.optix-install-dir }}
--build-arg WITH_PCL=1 --build-arg WITH_ROS2=1
--build-arg BUILD_CMD="./setup.py --with-weather"
--target=exporter --output=bin-weather .'
build-all:
needs: [ checkout-repository, load-env ]
runs-on: self-hosted
steps:
- run: '
docker build --build-context optix=${{ needs.load-env.outputs.optix-install-dir }}
--build-arg WITH_PCL=1 --build-arg WITH_ROS2=1
--build-arg BUILD_CMD=". /opt/ros/\$ROS_DISTRO/setup.sh && ./setup.py --with-pcl --with-ros2-standalone --with-udp --with-weather --build-taped-test"
--target=exporter --output=bin-all .'
####### TEST WITH RGL DOCKER IMAGE ######
test-core-dev:
needs: [build-core]
uses: ./.github/workflows/test-subworkflow.yml
with:
test-command: '
cd bin-core/bin/test && ./RobotecGPULidar_test'
docker-image: localhost:5000/robotecgpulidar-all:latest
test-pcl-dev:
needs: [ build-pcl ]
uses: ./.github/workflows/test-subworkflow.yml
with:
test-command: '
export RGL_TAPED_TEST_DATA_DIR=$(pwd)/external/rgl_blobs &&
cd bin-pcl/bin/test && ./RobotecGPULidar_test && ./RobotecGPULidar_taped_test'
docker-image: localhost:5000/robotecgpulidar-all:latest
test-ros2-dev:
needs: [ build-ros2 ]
uses: ./.github/workflows/test-subworkflow.yml
with:
# Source ROS2 and radar_msgs, standalone build is tested in prod environment
# Run tests twice, each for different RMW implementation
test-command: '
. /opt/ros/$ROS_DISTRO/setup.sh &&
. /opt/rgl/external/radar_msgs/install/setup.sh &&
cd bin-ros2/bin/test &&
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp && ./RobotecGPULidar_test &&
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp && ./RobotecGPULidar_test'
docker-image: localhost:5000/robotecgpulidar-all:latest
test-udp-dev:
needs: [ build-udp ]
uses: ./.github/workflows/test-subworkflow.yml
with:
test-command: '
cd bin-udp/bin/test && ./RobotecGPULidar_test'
docker-image: localhost:5000/robotecgpulidar-all:latest
test-weather-dev:
needs: [ build-weather ]
uses: ./.github/workflows/test-subworkflow.yml
with:
test-command: '
cd bin-weather/bin/test && ./RobotecGPULidar_test'
docker-image: localhost:5000/robotecgpulidar-all:latest
test-all-dev:
needs: [ build-all ]
uses: ./.github/workflows/test-subworkflow.yml
with:
# Source ROS2 and radar_msgs, standalone build is tested in prod environment
# Set `RGL_TEST_VLP16_CALIB_FILE` for UDP-ROS2 integration test
# Run tests twice, each for different RMW implementation
test-command: '
. /opt/ros/$ROS_DISTRO/setup.sh &&
. /opt/rgl/external/radar_msgs/install/setup.sh &&
export RGL_TEST_VLP16_CALIB_FILE=$(pwd)/extensions/udp/test/resources/Ros2Vlp16Calib.yaml &&
export RGL_TAPED_TEST_DATA_DIR=$(pwd)/external/rgl_blobs &&
cd bin-all/bin/test &&
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp && ./RobotecGPULidar_test && ./RobotecGPULidar_taped_test &&
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp && ./RobotecGPULidar_test && ./RobotecGPULidar_taped_test'
docker-image: localhost:5000/robotecgpulidar-all:latest
####### TEST WITH CLEAN UBUNTU DOCKER IMAGE ######
test-core-prod:
needs: [build-core]
uses: ./.github/workflows/test-subworkflow.yml
with:
test-command: '
cd bin-core/bin/test && ./RobotecGPULidar_test'
docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04
test-pcl-prod:
needs: [ build-pcl ]
uses: ./.github/workflows/test-subworkflow.yml
with:
# Additionally, install PCL extension dependent libraries for runtime
test-command: '
apt update && apt install -y libxcursor1 libgl1 &&
export RGL_TAPED_TEST_DATA_DIR=$(pwd)/external/rgl_blobs &&
cd bin-pcl/bin/test && ./RobotecGPULidar_test && ./RobotecGPULidar_taped_test'
docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04
test-ros2-prod:
needs: [ build-ros2 ]
uses: ./.github/workflows/test-subworkflow.yml
with:
# Copy ROS2 libraries to be visible for libRobotecGPULidar.so
# Run tests twice, each for different RMW implementation
test-command: '
cp -p bin-ros2/lib/ros2_standalone/* bin-ros2/lib &&
cd bin-ros2/bin/test &&
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp && ./RobotecGPULidar_test &&
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp && ./RobotecGPULidar_test'
docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04
test-udp-prod:
needs: [ build-udp ]
uses: ./.github/workflows/test-subworkflow.yml
with:
test-command: '
cd bin-udp/bin/test && ./RobotecGPULidar_test'
docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04
test-weather-prod:
needs: [ build-weather ]
uses: ./.github/workflows/test-subworkflow.yml
with:
test-command: '
cd bin-weather/bin/test && ./RobotecGPULidar_test'
docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04
test-all-prod:
needs: [ build-all ]
uses: ./.github/workflows/test-subworkflow.yml
with:
# Install PCL extension dependent libraries for runtime
# Copy ROS2 libraries to be visible for libRobotecGPULidar.so
# Run tests twice, each for different RMW implementation
test-command: '
apt update && apt install -y libxcursor1 libgl1 &&
export RGL_TAPED_TEST_DATA_DIR=$(pwd)/external/rgl_blobs &&
cp -p bin-all/lib/ros2_standalone/* bin-all/lib &&
cd bin-all/bin/test &&
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp && ./RobotecGPULidar_test && ./RobotecGPULidar_taped_test &&
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp && ./RobotecGPULidar_test && ./RobotecGPULidar_taped_test'
docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04