Skip to content

Commit

Permalink
adding colcon test sub scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tharp789 committed Sep 13, 2024
1 parent 4235135 commit de75fe7
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 29 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/colcon_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: ROS 2 Workspace Build
description: Build packages in a ROS 2 workspace
runs:
using: composite
steps:
- shell: bash
run: |
source install/setup.bash
colcon build --event-handlers console_cohesion+ --cmake-args
31 changes: 31 additions & 0 deletions .github/workflows/colcon_setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ROS 2 Workspace Setup
description: Setup tools and dependencies for a ROS 2 workspace
inputs:
distro:
description: The ROS 2 distribution to be used
default: iron
runs:
using: composite
steps:
- shell: bash
run: |
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list
- shell: bash
run: |
sudo apt update
sudo apt install -y python3-colcon-common-extensions python3-rosdep
- shell: bash
run: |
sudo rosdep init
rosdep update
rosdep install -y --rosdistro ${{ inputs.distro }} --from-paths . --ignore-src
- shell: bash
run: |
source /opt/ros/${{ inputs.distro }}/setup.bash
colcon build --packages-skip-regex '.*'
38 changes: 9 additions & 29 deletions .github/workflows/colcon_test.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
name: ci
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
name: ROS 2 Workspace Test
description: Test packages in a ROS 2 workspace
runs:
using: composite
steps:
- shell: bash
run: |
source install/setup.bash
colcon test --event-handlers console_cohesion+ --pytest-with-coverage --return-code-on-test-failure
28 changes: 28 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This YAML file is a GitHub Actions workflow configuration for running tests on a ROS 2
name: ros2 colcon tests
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: ros-tooling/setup-ros@latest
with:
version: humble
- name: Colcon Test
run: |
source /opt/ros/humble/setup.bash
colcon test --event-handlers console_cohesion+ --result-base result
colcon test-result --verbose --result-base result
- name: Upload Test Results
uses: actions/upload-artifact@v3
with:
name: test-results
path: result


0 comments on commit de75fe7

Please sign in to comment.