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

CI for ROS 2 Rolling #42

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml → .github/workflows/ci-humble.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI-Humble
on:
push:
branches: [ main ]
Expand All @@ -21,6 +21,7 @@ jobs:
tags: ethercat_driver_ros2:humble
file: .docker/Dockerfile
push: false
build-args: ROS_DISTRO=humble

- name: Build
uses: addnab/docker-run-action@v3
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/ci-rolling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI-Rolling
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Prepare
run: |
mkdir -p ${{github.workspace}}/src
- uses: actions/checkout@v2
with:
path: src/ethercat_driver_ros2

- name: Build Docker Image
uses: docker/build-push-action@v2
with:
tags: ethercat_driver_ros2:rolling
file: .docker/Dockerfile
push: false
build-args: ROS_DISTRO=rolling

- name: Build
uses: addnab/docker-run-action@v3
with:
image: ethercat_driver_ros2:rolling
options: -v ${{github.workspace}}/:/ros/
run: |
apt update
apt upgrade -y
cd /ros
. /opt/ros/rolling/setup.sh
rosdep install --ignore-src --from-paths . -y -r && \
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

- name: Tests
uses: addnab/docker-run-action@v3
with:
image: ethercat_driver_ros2:rolling
options: -v ${{github.workspace}}/:/ros/
run: |
apt update
apt upgrade -y
cd /ros
. /opt/ros/rolling/setup.sh
rosdep install --ignore-src --from-paths . -y -r && \
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
colcon test
colcon test-result

- name: Upload Tests to Artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: test-results
path: build/*/test_results/*/*.xml

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: build/*/test_results/*/*.xml
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ Example:
```

## 2. Building `ethercat_driver_ros2`
1. Install `ros2` packages. The current development is based of `ros2 humble`. Installation steps are described [here](https://docs.ros.org/en/humble/Installation.html).
1. Install `ros2` packages. The current development is based on `ros2 rolling` and compatible with `ros2 humble`. Installation steps are described [here](https://docs.ros.org/en/rolling/Installation.html).
2. Source your `ros2` environment:
```shell
source /opt/ros/humble/setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash
```
**NOTE**: The ros2 environment needs to be sources in every used terminal. If only one distribution of ros2 is used, it can be added to the `~/.bashrc` file.
3. Install `colcon` and its extensions :
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# ethercat_driver_ros2
[![Licence](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![DOI](https://zenodo.org/badge/491930126.svg)](https://zenodo.org/badge/latestdoi/491930126)
[![Build](https://github.com/ICube-Robotics/ethercat_driver_ros2/actions/workflows/ci.yml/badge.svg)](https://github.com/ICube-Robotics/ethercat_driver_ros2/actions/workflows/ci.yml)
[![CI-Humble](https://github.com/ICube-Robotics/ethercat_driver_ros2/actions/workflows/ci-humble.yml/badge.svg)](https://github.com/ICube-Robotics/ethercat_driver_ros2/actions/workflows/ci-humble.yml)
[![CI-Rolling](https://github.com/ICube-Robotics/ethercat_driver_ros2/actions/workflows/ci-rolling.yml/badge.svg)](https://github.com/ICube-Robotics/ethercat_driver_ros2/actions/workflows/ci-rolling.yml)

Implementation of a `Hardware Interface` for simple Ethercat module integration with [`ros2_control`](https://github.com/ros-controls/ros2_control) and building upon [IgH EtherCAT Master for Linux](https://etherlab.org/en/ethercat/).

Expand Down