From 69174f0b6b5c19e2c323525799bb0f22f17ef9a7 Mon Sep 17 00:00:00 2001 From: Max Schwarz Date: Sat, 6 Sep 2025 16:10:26 +0200 Subject: [PATCH 1/2] .github: basic workflow for ROS Noetic --- .github/workflows/main.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..6efb1073 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,28 @@ +on: [push] + +jobs: + noetic: + runs-on: ubuntu-latest + name: "ROS Noetic" + container: + image: ros:noetic-ros-core + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + path: src/rosmon + - name: "Install dependencies" + run: | + apt update + apt install -y python3-colcon-common-extensions python3-rosdep build-essential + rosdep init + rosdep update --rosdistro=noetic + rosdep install --rosdistro=noetic --ignore-src --from-paths src -y + - name: Compile + run: | + . /opt/ros/noetic/setup.sh + colcon build --event-handlers console_cohesion+ desktop_notification- --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo + - name: Test + run: | + . install/setup.sh + colcon test --event-handlers console_cohesion+ desktop_notification- --return-code-on-test-failure From ce8a1a19b42043e4cf708144e307ee443eb48bd6 Mon Sep 17 00:00:00 2001 From: Max Schwarz Date: Sat, 6 Sep 2025 23:21:12 +0200 Subject: [PATCH 2/2] .github: test melodic as well --- .github/workflows/main.yml | 42 +++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6efb1073..aacc0041 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,28 +1,38 @@ on: [push] jobs: - noetic: + build: + strategy: + matrix: + rosdistro: [melodic, noetic] runs-on: ubuntu-latest - name: "ROS Noetic" - container: - image: ros:noetic-ros-core + name: "ROS ${{ matrix.rosdistro }}" steps: - name: Checkout uses: actions/checkout@v5 with: path: src/rosmon - - name: "Install dependencies" + - name: Start Docker container run: | - apt update - apt install -y python3-colcon-common-extensions python3-rosdep build-essential - rosdep init - rosdep update --rosdistro=noetic - rosdep install --rosdistro=noetic --ignore-src --from-paths src -y + docker run --name build-container -d -v ${{ github.workspace }}:/workspace ros:${{ matrix.rosdistro }}-ros-core tail -f /dev/null + - name: "Install dependencies" + env: + SCRIPT: | + apt update + apt install -y python3-colcon-common-extensions python3-rosdep build-essential + rosdep init + rosdep update --rosdistro=${{ matrix.rosdistro }} + rosdep install --rosdistro=${{ matrix.rosdistro }} --ignore-src --from-paths src -y + run: docker exec -w /workspace build-container bash -c "$SCRIPT" - name: Compile - run: | - . /opt/ros/noetic/setup.sh - colcon build --event-handlers console_cohesion+ desktop_notification- --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo + env: + SCRIPT: | + . /opt/ros/${{ matrix.rosdistro }}/setup.sh + colcon build --event-handlers console_cohesion+ desktop_notification- --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo + run: docker exec -w /workspace build-container bash -c "$SCRIPT" - name: Test - run: | - . install/setup.sh - colcon test --event-handlers console_cohesion+ desktop_notification- --return-code-on-test-failure + env: + SCRIPT: | + . install/setup.sh + colcon test --event-handlers console_cohesion+ desktop_notification- --return-code-on-test-failure + run: docker exec -w /workspace build-container bash -c "$SCRIPT"