Skip to content

Commit

Permalink
Add colcon CI
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 committed Jan 9, 2024
1 parent 067e7f1 commit 68d515e
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/colcon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: colcon build/test

on:
pull_request:
push:
branches: [humble]

concurrency:
group: ci-${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-test:
runs-on: ubuntu-22.04
container: ardupilot/ardupilot-dev-ros:latest
strategy:
fail-fast: false # don't cancel if a job from the matrix fails
steps:
# git checkout the PR
- uses: actions/checkout@v4
with:
submodules: 'recursive'
path: src/ardupilot_ros
# https://ardupilot.org/dev/docs/ros2.html#installation-ubuntu
- name: Pull in repos with vcs
run: |
cd src
apt update && apt -y install wget python3-pip
wget --progress=dot:giga https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/ros2_gz.repos
vcs import --recursive --debug --shallow --skip-existing < ros2_gz.repos
- name: Install rosdep dependencies
shell: 'bash'
run: |
apt update
apt install python3
rosdep update
# Workaround for flake8 attribute error
# https://github.com/ArduPilot/ardupilot/pull/24277#issuecomment-1632833433
python3 -m pip install flake8==3.7.9
source /opt/ros/humble/setup.bash
rosdep install --from-paths src --ignore-src --default-yes --skip-keys "pynput gz-sim7 gz-cmake3 gz-plugin2 gz-common5"
- name: Install MAVProxy
run: |
# Install this specific version just to prevent rolling updates.
# These are the latest available
python3 -m pip install MAVProxy==1.8.67
- name: Install local pymavlink
working-directory: ./src/ardupilot/modules/mavlink/pymavlink
run: |
pip install . -U --user
- name: Build with colcon
shell: 'bash'
run: |
source /opt/ros/humble/setup.bash
colcon build --packages-up-to ardupilot_dds_tests --cmake-args -DBUILD_TESTING=ON
- name: Test with colcon
shell: 'bash'
run: |
source install/setup.bash
colcon test --packages-select ardupilot_dds_tests --event-handlers=console_cohesion+
- name: Report colcon test results
run: |
colcon test-result --all --verbose

0 comments on commit 68d515e

Please sign in to comment.