Skip to content

Commit

Permalink
Add basic CI (#2)
Browse files Browse the repository at this point in the history
* add docker config

* add github workflow

* add badges

* gitkeep meshes folder

* remove publish
  • Loading branch information
tpoignonec authored Nov 8, 2023
1 parent cc6ffb8 commit 887c030
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG ROS_DISTRO="humble"
FROM ros:${ROS_DISTRO}

COPY . /ros2_dev/hk1d_ros2

RUN apt update && \
apt install autoconf libtool -y
RUN mkdir ec_dev && cd ec_dev && \
git clone https://gitlab.com/etherlab.org/ethercat.git && \
cd ethercat && \
git checkout stable-1.5 && \
./bootstrap && \
./configure --prefix=/usr/local/etherlab --disable-kernel && \
make && make install
8 changes: 8 additions & 0 deletions .docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# hk1d ROS2 Docker Containers
Provides a basic preconfigured docker container for development purposes.
To use it, make sure you have [Docker](https://docs.docker.com/get-docker/) installed, then build and run the image :

```shell
$ docker build --tag hk1d_ros2:humble --file .docker/Dockerfile .
$ docker run -it --privileged --network=host hk1d_ros2:humble
```
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
23 changes: 23 additions & 0 deletions .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action

name: Format

on:
workflow_dispatch:
pull_request:

jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install system hooks
run: sudo apt install -qq clang-format-14 cppcheck
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI
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@v3
with:
path: src/hk1d_ros2

- name: Build Docker Image
uses: docker/build-push-action@v4
with:
tags: hk1d_ros2:humble
file: .docker/Dockerfile
push: false

- name: Build
uses: addnab/docker-run-action@v3
with:
image: hk1d_ros2:humble
options: -v ${{github.workspace}}/:/ros/
run: |
cd /ros
. /opt/ros/humble/setup.sh
vcs import . < src/hk1d_ros2/hk1d_ros2.repos
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: hk1d_ros2:humble
options: -v ${{github.workspace}}/:/ros/
run: |
cd /ros
. /opt/ros/humble/setup.sh
vcs import . < src/hk1d_ros2/hk1d_ros2.repos
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@v3
# if: always()
# with:
# name: test-results
# path: build/*/test_results/*/*.xml

# - name: Publish Unit Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
# if: always()
# with:
# files: build/*/test_results/*/*.xml
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# hk1d_ros2

ROS2 stack to use a 1-Dof haptic kit used at the ICube laboratory.
ROS2 control stack for a 1-Dof haptic kit used at the ICube laboratory.


[![Licence](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![CI](../../actions/workflows/ci.yml/badge.svg?branch=main)](../../actions/workflows/ci.yml?query=branch:main)

***The current devs are based on the humble ROS 2 distribution (Ubuntu 22.04 LTS)***

## Installation

Expand All @@ -13,7 +19,8 @@ See for instance the [procedure](https://github.com/ICube-Robotics/ethercat_driv
```bash
cd <ros_ws>/src
git clone https://github.com/ICube-Robotics/hk1d_ros2.git
vcs import src < src/hk1d_ros2/hk1d_ros2.repos # MANDATORY!!!
vcs import . < hk1d_ros2/hk1d_ros2.repos # MANDATORY!!!
cd ..
rosdep install --ignore-src --from-paths . -y -r
```

Expand Down
Empty file.

0 comments on commit 887c030

Please sign in to comment.