|
| 1 | +name: build-and-test |
| 2 | + |
| 3 | +run-name: Build & test for PR '${{ github.event.pull_request.title }}' |
| 4 | + |
| 5 | +on: [pull_request] |
| 6 | + |
| 7 | +# Cancel previous runs if new changes on PR/branch |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | +###### PREPARE WORKFLOW ###### |
| 14 | + checkout-repository: |
| 15 | + runs-on: self-hosted |
| 16 | + steps: |
| 17 | + - name: Checkout repository code |
| 18 | + uses: actions/checkout@v3 |
| 19 | + - name: Import private extensions |
| 20 | + run: vcs import < extensions.repos |
| 21 | + |
| 22 | + load-env: |
| 23 | + uses: ./.github/workflows/load-env-subworkflow.yml |
| 24 | + |
| 25 | +###### BUILD USING RGL DOCKER ###### |
| 26 | + build-core: |
| 27 | + needs: [checkout-repository, load-env] |
| 28 | + uses: ./.github/workflows/build-subworkflow.yml |
| 29 | + with: |
| 30 | + build-command: ./setup.py --build-dir build-core |
| 31 | + self-hosted-user-id: ${{ needs.load-env.outputs.user-id }} |
| 32 | + optix-install-dir: ${{ needs.load-env.outputs.optix-install-dir }} |
| 33 | + docker-image: localhost:5000/rgl:latest |
| 34 | + |
| 35 | + build-pcl: |
| 36 | + needs: [checkout-repository, load-env] |
| 37 | + uses: ./.github/workflows/build-subworkflow.yml |
| 38 | + with: |
| 39 | + build-command: './setup.py --with-pcl --build-dir build-pcl' |
| 40 | + self-hosted-user-id: ${{ needs.load-env.outputs.user-id }} |
| 41 | + optix-install-dir: ${{ needs.load-env.outputs.optix-install-dir }} |
| 42 | + docker-image: localhost:5000/rgl:latest |
| 43 | + |
| 44 | + build-ros2: |
| 45 | + needs: [ checkout-repository, load-env ] |
| 46 | + uses: ./.github/workflows/build-subworkflow.yml |
| 47 | + with: |
| 48 | + build-command: ' |
| 49 | + source /opt/ros/humble/setup.bash && |
| 50 | + ./setup.py --with-ros2-standalone --build-dir build-ros2' |
| 51 | + self-hosted-user-id: ${{ needs.load-env.outputs.user-id }} |
| 52 | + optix-install-dir: ${{ needs.load-env.outputs.optix-install-dir }} |
| 53 | + docker-image: localhost:5000/rgl:latest |
| 54 | + |
| 55 | + build-udp: |
| 56 | + needs: [ checkout-repository, load-env ] |
| 57 | + uses: ./.github/workflows/build-subworkflow.yml |
| 58 | + with: |
| 59 | + build-command: './setup.py --with-udp --build-dir build-udp' |
| 60 | + self-hosted-user-id: ${{ needs.load-env.outputs.user-id }} |
| 61 | + optix-install-dir: ${{ needs.load-env.outputs.optix-install-dir }} |
| 62 | + docker-image: localhost:5000/rgl:latest |
| 63 | + |
| 64 | + build-snow: |
| 65 | + needs: [ checkout-repository, load-env ] |
| 66 | + uses: ./.github/workflows/build-subworkflow.yml |
| 67 | + with: |
| 68 | + build-command: './setup.py --with-snow --build-dir build-snow' |
| 69 | + self-hosted-user-id: ${{ needs.load-env.outputs.user-id }} |
| 70 | + optix-install-dir: ${{ needs.load-env.outputs.optix-install-dir }} |
| 71 | + docker-image: localhost:5000/rgl:latest |
| 72 | + |
| 73 | + build-all: |
| 74 | + needs: [ checkout-repository, load-env ] |
| 75 | + uses: ./.github/workflows/build-subworkflow.yml |
| 76 | + with: |
| 77 | + build-command: ' |
| 78 | + source /opt/ros/humble/setup.bash && |
| 79 | + ./setup.py --with-pcl --with-ros2-standalone --with-udp --with-snow --build-dir build-all' |
| 80 | + self-hosted-user-id: ${{ needs.load-env.outputs.user-id }} |
| 81 | + optix-install-dir: ${{ needs.load-env.outputs.optix-install-dir }} |
| 82 | + docker-image: localhost:5000/rgl:latest |
| 83 | + |
| 84 | +###### TEST WITH RGL DOCKER IMAGE ###### |
| 85 | + test-core-dev: |
| 86 | + needs: [build-core] |
| 87 | + uses: ./.github/workflows/test-subworkflow.yml |
| 88 | + with: |
| 89 | + test-command: 'cd build-core/test && ./RobotecGPULidar_test' |
| 90 | + docker-image: localhost:5000/rgl:latest |
| 91 | + |
| 92 | + test-pcl-dev: |
| 93 | + needs: [ build-pcl ] |
| 94 | + uses: ./.github/workflows/test-subworkflow.yml |
| 95 | + with: |
| 96 | + test-command: 'cd build-pcl/test && ./RobotecGPULidar_test' |
| 97 | + docker-image: localhost:5000/rgl:latest |
| 98 | + |
| 99 | + test-ros2-dev: |
| 100 | + needs: [ build-ros2 ] |
| 101 | + uses: ./.github/workflows/test-subworkflow.yml |
| 102 | + with: |
| 103 | + # Source ROS2 and radar_msgs, standalone build is tested in prod environment |
| 104 | + # Run tests twice, each for different RMW implementation |
| 105 | + test-command: ' |
| 106 | + source /opt/ros/humble/setup.bash && |
| 107 | + source /rgldep/radar_msgs/install/setup.bash && |
| 108 | + cd build-ros2/test && |
| 109 | + export RMW_IMPLEMENTATION=rmw_fastrtps_cpp && ./RobotecGPULidar_test && |
| 110 | + export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp && ./RobotecGPULidar_test' |
| 111 | + docker-image: localhost:5000/rgl:latest |
| 112 | + |
| 113 | + test-udp-dev: |
| 114 | + needs: [ build-udp ] |
| 115 | + uses: ./.github/workflows/test-subworkflow.yml |
| 116 | + with: |
| 117 | + test-command: 'cd build-udp/test && ./RobotecGPULidar_test' |
| 118 | + docker-image: localhost:5000/rgl:latest |
| 119 | + |
| 120 | + test-snow-dev: |
| 121 | + needs: [ build-snow ] |
| 122 | + uses: ./.github/workflows/test-subworkflow.yml |
| 123 | + with: |
| 124 | + test-command: 'cd build-snow/test && ./RobotecGPULidar_test' |
| 125 | + docker-image: localhost:5000/rgl:latest |
| 126 | + |
| 127 | + test-all-dev: |
| 128 | + needs: [ build-all ] |
| 129 | + uses: ./.github/workflows/test-subworkflow.yml |
| 130 | + with: |
| 131 | + # Source ROS2 and radar_msgs, standalone build is tested in prod environment |
| 132 | + # Set `RGL_TEST_VLP16_CALIB_FILE` for UDP-ROS2 integration test |
| 133 | + # Run tests twice, each for different RMW implementation |
| 134 | + test-command: ' |
| 135 | + source /opt/ros/humble/setup.bash && |
| 136 | + source /rgldep/radar_msgs/install/setup.bash && |
| 137 | + export RGL_TEST_VLP16_CALIB_FILE=$(pwd)/extensions/udp/test/resources/Ros2Vlp16Calib.yaml && |
| 138 | + cd build-all/test && |
| 139 | + export RMW_IMPLEMENTATION=rmw_fastrtps_cpp && ./RobotecGPULidar_test && |
| 140 | + export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp && ./RobotecGPULidar_test' |
| 141 | + docker-image: localhost:5000/rgl:latest |
| 142 | + |
| 143 | +###### TEST WITH CLEAN UBUNTU DOCKER IMAGE ###### |
| 144 | + test-core-prod: |
| 145 | + needs: [build-core] |
| 146 | + uses: ./.github/workflows/test-subworkflow.yml |
| 147 | + with: |
| 148 | + test-command: 'cd build-core/test && ./RobotecGPULidar_test' |
| 149 | + docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04 |
| 150 | + |
| 151 | + test-pcl-prod: |
| 152 | + needs: [ build-pcl ] |
| 153 | + uses: ./.github/workflows/test-subworkflow.yml |
| 154 | + with: |
| 155 | + # Additionally, install PCL extension dependent libraries for runtime |
| 156 | + test-command: ' |
| 157 | + apt update && apt install -y libxcursor1 libgl1 && |
| 158 | + cd build-pcl/test && ./RobotecGPULidar_test' |
| 159 | + docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04 |
| 160 | + |
| 161 | + test-ros2-prod: |
| 162 | + needs: [ build-ros2 ] |
| 163 | + uses: ./.github/workflows/test-subworkflow.yml |
| 164 | + with: |
| 165 | + # Copy ROS2 libraries to be visible for libRobotecGPULidar.so |
| 166 | + # Run tests twice, each for different RMW implementation |
| 167 | + test-command: ' |
| 168 | + cd build-ros2/test && |
| 169 | + cp -r ../ros2_standalone/*.so* ../ && |
| 170 | + export RMW_IMPLEMENTATION=rmw_fastrtps_cpp && ./RobotecGPULidar_test && |
| 171 | + export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp && ./RobotecGPULidar_test' |
| 172 | + docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04 |
| 173 | + |
| 174 | + test-udp-prod: |
| 175 | + needs: [ build-udp ] |
| 176 | + uses: ./.github/workflows/test-subworkflow.yml |
| 177 | + with: |
| 178 | + test-command: 'cd build-udp/test && ./RobotecGPULidar_test' |
| 179 | + docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04 |
| 180 | + |
| 181 | + test-snow-prod: |
| 182 | + needs: [ build-snow ] |
| 183 | + uses: ./.github/workflows/test-subworkflow.yml |
| 184 | + with: |
| 185 | + test-command: 'cd build-snow/test && ./RobotecGPULidar_test' |
| 186 | + docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04 |
| 187 | + |
| 188 | + test-all-prod: |
| 189 | + needs: [ build-all ] |
| 190 | + uses: ./.github/workflows/test-subworkflow.yml |
| 191 | + with: |
| 192 | + # Install PCL extension dependent libraries for runtime |
| 193 | + # Copy ROS2 libraries to be visible for libRobotecGPULidar.so |
| 194 | + # Run tests twice, each for different RMW implementation |
| 195 | + test-command: ' |
| 196 | + apt update && apt install -y libxcursor1 libgl1 && |
| 197 | + cd build-all/test && |
| 198 | + cp -r ../ros2_standalone/*.so* ../ && |
| 199 | + export RMW_IMPLEMENTATION=rmw_fastrtps_cpp && ./RobotecGPULidar_test && |
| 200 | + export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp && ./RobotecGPULidar_test' |
| 201 | + docker-image: nvidia/cuda:11.7.1-base-ubuntu22.04 |
0 commit comments