Skip to content

Commit

Permalink
add basic workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoignonec committed Oct 17, 2023
1 parent 7b68f04 commit f03f2a4
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
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
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
CI:
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
checks: write
pull-requests: write
steps:
- name: Prepare
run: |
mkdir -p ${{github.workspace}}/src
- uses: actions/checkout@v4
with:
path: src/ft_tools_ros2

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

- name: Build
uses: addnab/docker-run-action@v3
with:
image: ft_tools_ros2:humble
options: -v ${{github.workspace}}/:/ros/
run: |
cd /ros # structure = <...>/ros/src/ft_tools_ros2/<...>
. /opt/ros/humble/setup.sh
vcs import src < src/ft_tools_ros2/ft_tools_ros2.repos
rosdep install --ignore-src --from-paths . -y -r
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --symlink-install
- name: Tests
uses: addnab/docker-run-action@v3
with:
image: ft_tools_ros2:humble
options: -v ${{github.workspace}}/:/ros/
run: |
cd /ros
. /opt/ros/humble/setup.sh
vcs import src < src/ft_tools_ros2/ft_tools_ros2.repos
rosdep install --ignore-src --from-paths . -y -r
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --symlink-install
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

0 comments on commit f03f2a4

Please sign in to comment.