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 3d9e387
Showing 1 changed file with 35 additions and 22 deletions.
57 changes: 35 additions & 22 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ name: Build and Test
on:
push:
branches:
- 'ros2'
- 'main'
pull_request:
branches:
- 'ros2/*'
- 'ros2'
- 'main/*'
- 'main'
workflow_dispatch:

env:
ROS_WORKSPACE_PATH: colcon_ws/src

jobs:
get_ros_distros:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -74,34 +77,44 @@ 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
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
uses: antmicro/renode-linux-runner-action@v1
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
shared-dirs: |
$ROS_WORKSPACE_PATH/build/usb_cam
renode-run: ./test_usb_cam_lib
devices: vivid
- 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 3d9e387

Please sign in to comment.