Skip to content

Commit

Permalink
Update CI to use raw colcon commands
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Flynn <[email protected]>
  • Loading branch information
flynneva committed Jan 26, 2025
1 parent dc68016 commit 0eb59be
Showing 1 changed file with 37 additions and 24 deletions.
61 changes: 37 additions & 24 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@ name: Build and Test
on:
push:
branches:
- 'ros2'
- 'main'
pull_request:
branches:
- 'ros2/*'
- 'ros2'
- 'main/*'
- 'main'
workflow_dispatch:

env:
ROS_WORKSPACE_PATH: workspace/src

jobs:
get_ros_distros:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install curl jq
sudo apt-get -y install curl jq policykit-1 libgtk2.0-0 screen uml-utilities gtk-sharp2 libc6-dev libicu-dev gcc python3 python3-pip
mkdir renode_portable
wget https://builds.renode.io/renode-latest.linux-portable.tar.gz
tar xf renode-latest.linux-portable.tar.gz -C renode_portable --strip-components=1
- name: Get active distributions
run: |
wget https://raw.githubusercontent.com/flynneva/active_ros_distros/0.1.0/main.py -O active_ros_distros.py
Expand Down Expand Up @@ -74,34 +80,41 @@ jobs:
image: rostooling/setup-ros-docker:${{ matrix.docker_image }}
steps:
- name: Setup Directories
run: mkdir -p ros_ws/src
run: mkdir -p $ROS_WORKSPACE_PATH
- name: checkout
uses: actions/checkout@v4
with:
path: ros_ws/src
- name: Build and Test ROS 2
id: build_and_test_step
uses: ros-tooling/action-ros-ci@master
with:
package-name: usb_cam
target-ros2-distro: ${{ matrix.ros_distro }}
vcs-repo-file-url: ""
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc"]
}
}
# If possible, pin the repository in the workflow to a specific commit to avoid
# changes in colcon-mixin-repository from breaking your tests.
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/1ddb69bedfd1f04c2f000e95452f7c24a4d6176b/index.yaml
- uses: actions/upload-artifact@v1
path: $ROS_WORKSPACE_PATH/usb_cam
- name: build
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
cd $ROS_WORKSPACE_PATH
colcon build --packages-select usb_cam
- name: unit tests
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
cd $ROS_WORKSPACE_PATH
colcon test --packages-select usb_cam
# Compile again, this time enabling integration tests
- name: Build integration tests
shell: bash
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
cd $ROS_WORKSPACE_PATH
colcon build --packages-select usb_cam --cmake-args -DSANITIZE=1 -DINTEGRATION_TESTS=1
- name: Run integration tests
shell: bash
run: |
renode_portable/renode --disable-gui --version
- uses: actions/upload-artifact@v4
with:
name: colcon-logs-${{ matrix.ros_distro }}
path: ${{ steps.build_and_test_step.outputs.ros-workspace-directory-name }}/log
if: always()
continue-on-error: true
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: lcov-logs-${{ matrix.ros_distro }}
path: ${{ steps.build_and_test_step.outputs.ros-workspace-directory-name }}/lcov
Expand Down

0 comments on commit 0eb59be

Please sign in to comment.