Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup ros2 workflow #1

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/ros2_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: ROS2 CI

on:
push:
branches: [ main, unittest ]
pull_request:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest

container:
image: osrf/ros:humble-desktop

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y curl gnupg lsb-release

- name: Import ROS2 apt key
run: |
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add -

- name: Setup sources.list
run: |
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'

- name: Install ROS2 Humble dependencies
run: |
sudo apt update
sudo apt install -y python3-colcon-common-extensions python3-rosdep python3-vcstool

- name: Initialize rosdep
run: |
if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
sudo rosdep init
fi
rosdep update

- name: Install package dependencies
run: |
cd robile_safety
rosdep install --from-paths . --ignore-src --rosdistro humble -y

- name: Build the package
run: |
cd robile_safety
source /opt/ros/humble/setup.bash
colcon build --symlink-install
shell: bash

- name: Run tests
run: |
cd robile_safety
source /opt/ros/humble/setup.bash
colcon test
colcon test-result --verbose
shell: bash