diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-humble.yml similarity index 96% rename from .github/workflows/ci.yml rename to .github/workflows/ci-humble.yml index b9f13401..4c283fba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-humble.yml @@ -1,4 +1,4 @@ -name: CI +name: CI-Humble on: push: branches: [ main ] @@ -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 diff --git a/.github/workflows/ci-rolling.yml b/.github/workflows/ci-rolling.yml new file mode 100644 index 00000000..e8f61900 --- /dev/null +++ b/.github/workflows/ci-rolling.yml @@ -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 diff --git a/INSTALL.md b/INSTALL.md index b99108bc..0209c338 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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 : diff --git a/README.md b/README.md index 191cf377..8a55cdbf 100644 --- a/README.md +++ b/README.md @@ -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/).