Support for ros launch #1175
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: drake-ros continuous integration | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
test_against_debs: | |
if: "! contains(github.event.pull_request.labels.*.name, 'status: defer ci')" | |
strategy: | |
matrix: | |
include: | |
# TODO : Include rolling later if available on jammy or noble. | |
- os_code_name: jammy | |
ros_distro: humble | |
name: test_against_${{matrix.ros_distro}}_debs | |
runs-on: ubuntu-latest | |
container: | |
image: robotlocomotion/drake:${{matrix.os_code_name}} | |
env: | |
PYTHONPATH: | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Simplify apt upgrades | |
run: $GITHUB_WORKSPACE/.github/simplify_apt_and_upgrades.sh | |
- uses: ros-tooling/[email protected] | |
with: | |
required-ros-distributions: ${{matrix.ros_distro}} | |
use-ros2-testing: "true" | |
- name: Cope with Python 2 pollution | |
run: apt-get update && apt-get install -y python-is-python3 | |
- name: Build and test all packages | |
uses: ros-tooling/[email protected] | |
with: | |
target-ros2-distro: ${{matrix.ros_distro}} | |
test_against_archive: | |
if: "! contains(github.event.pull_request.labels.*.name, 'status: defer ci')" | |
strategy: | |
matrix: | |
include: | |
# TODO : Include rolling later if available on jammy or noble. | |
- os_code_name: jammy | |
ros_distro: humble | |
name: test_against_${{matrix.ros_distro}}_archive | |
runs-on: ubuntu-latest | |
container: | |
image: robotlocomotion/drake:${{matrix.os_code_name}} | |
env: | |
PYTHONPATH: | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Simplify apt upgrades | |
run: $GITHUB_WORKSPACE/.github/simplify_apt_and_upgrades.sh | |
- uses: ros-tooling/[email protected] | |
- name: Install dependencies to build ROS packages | |
run: | | |
sudo mkdir -p /opt/ros/${{matrix.ros_distro}} | |
wget -q https://repo.ros2.org/ci_archives/nightly-cyclonedds/ros2-${{matrix.ros_distro}}-linux-${{matrix.os_code_name}}-amd64-ci-CHECKSUM | |
wget -q http://repo.ros2.org/ci_archives/nightly-cyclonedds/ros2-${{matrix.ros_distro}}-linux-${{matrix.os_code_name}}-amd64-ci.tar.bz2 | |
sha256sum -c ros2-${{matrix.ros_distro}}-linux-${{matrix.os_code_name}}-amd64-ci-CHECKSUM | |
sudo tar xf ros2-${{matrix.ros_distro}}-linux-${{matrix.os_code_name}}-amd64-ci.tar.bz2 --strip-components=1 -C /opt/ros/${{matrix.ros_distro}} | |
sed -i 's|/tmp/ws/install_isolated|/opt/ros/${{matrix.ros_distro}}|g' /opt/ros/${{matrix.ros_distro}}/setup.sh | |
rm ros2-${{matrix.ros_distro}}-linux-${{matrix.os_code_name}}-amd64-ci.tar.bz2 | |
# TODO(sloretz) Use bazel_ros2_rules/ros2/compute_system_rosdeps.py to de-duplicate rosdep invocation knowledge | |
SHARE_DIRS=`find /opt/ros/${{matrix.ros_distro}} -maxdepth 2 -name share -type d` | |
# TODO(sloretz) remove --skip-keys for rosbag2_performance_benchmarking_msgs when https://github.com/ros2/rosbag2/pull/1242 lands | |
rosdep update && rosdep install --from-paths $SHARE_DIRS . --ignore-src -y \ | |
-t exec -t buildtool_export -t build_export \ | |
--skip-keys "cyclonedds fastcdr fastrtps rmw_connextdds rmw_cyclonedds_cpp rmw_fastrtps_dynamic_cpp rti-connext-dds-5.3.1 urdfdom_headers iceoryx_binding_c rosidl_typesupport_fastrtps_c rosidl_typesupport_fastrtps_cpp rosbag2_performance_benchmarking_msgs" | |
- name: Cope with Python 2 pollution | |
run: apt-get update && apt-get install -y python-is-python3 | |
- name: Build all packages | |
run: | | |
. /opt/ros/${{matrix.ros_distro}}/setup.sh | |
colcon build --event-handlers console_cohesion+ | |
- name: Test all packages | |
run: | | |
. /opt/ros/${{matrix.ros_distro}}/setup.sh | |
colcon test --event-handlers console_cohesion+ |