Skip to content

Commit

Permalink
Update CI config and add pre-commit-config.
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl authored and bmagyar committed Jul 12, 2021
1 parent d8784d8 commit 02b70e3
Show file tree
Hide file tree
Showing 12 changed files with 516 additions and 47 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build Source
on:
push:
branches:
- ros2-master
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '28 3 * * *'

jobs:
source:
name: source build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
with:
target-ros2-distro: rolling
# build all packages listed in the meta package
package-name:
control_toolbox
vcs-repo-file-url: |
https://raw.githubusercontent.com/ros-controls/control_toolbox/ros2-master/control_toolbox.rosinstall
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- uses: codecov/[email protected]
with:
file: ros_ws/lcov/total_coverage.info
flags: unittests
name: codecov-umbrella
- uses: actions/upload-artifact@v1
with:
name: colcon-logs-${{ matrix.os }}
path: ros_ws/log

56 changes: 56 additions & 0 deletions .github/workflows/build-foxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: Build
on:
pull_request:
push:
branches:
- ros2-master
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '28 6 * * *'

jobs:
binary:
name: binary build
runs-on: ubuntu-latest
strategy:
matrix:
env:
- {ROS_DISTRO: foxy, ROS_REPO: main}
- {ROS_DISTRO: foxy, ROS_REPO: testing}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
BASEDIR: ${{ github.workspace }}/.work
CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
DOWNSTREAM_WORKSPACE: https://raw.githubusercontent.com/ros-controls/ros2_control/master/ros2_control/ros2_control.repos
steps:
- uses: actions/checkout@v1
# The target directory cache doesn't include the source directory because
# that comes from the checkout. See "prepare target_ws for cache" task below
- name: cache target_ws
if: ${{ ! matrix.env.CCOV }}
uses: pat-s/[email protected]
with:
path: ${{ env.BASEDIR }}/target_ws
key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }}
restore-keys: |
target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}
- name: cache ccache
uses: pat-s/[email protected]
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
ccache-${{ env.CACHE_PREFIX }}
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
- name: prepare target_ws for cache
if: ${{ always() && ! matrix.env.CCOV }}
run: |
du -sh ${{ env.BASEDIR }}/target_ws
sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
sudo rm -rf ${{ env.BASEDIR }}/target_ws/src
du -sh ${{ env.BASEDIR }}/target_ws
57 changes: 57 additions & 0 deletions .github/workflows/build-galactic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: Build galactic
on:
pull_request:
push:
branches:
- ros2-master
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '28 6 * * *'

jobs:
binary:
name: binary build
runs-on: ubuntu-latest
strategy:
matrix:
env:
- {ROS_DISTRO: galactic, ROS_REPO: main}
- {ROS_DISTRO: galactic, ROS_REPO: testing}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
BASEDIR: ${{ github.workspace }}/.work
CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
DOWNSTREAM_WORKSPACE: https://raw.githubusercontent.com/ros-controls/ros2_control/master/ros2_control/ros2_control.repos
steps:
- uses: actions/checkout@v1
# The target directory cache doesn't include the source directory because
# that comes from the checkout. See "prepare target_ws for cache" task below
- name: cache target_ws
if: ${{ ! matrix.env.CCOV }}
uses: pat-s/[email protected]
with:
path: ${{ env.BASEDIR }}/target_ws
key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }}
restore-keys: |
target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}
- name: cache ccache
uses: pat-s/[email protected]
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
ccache-${{ env.CACHE_PREFIX }}
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
- name: prepare target_ws for cache
if: ${{ always() && ! matrix.env.CCOV }}
run: |
du -sh ${{ env.BASEDIR }}/target_ws
sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
sudo rm -rf ${{ env.BASEDIR }}/target_ws/src
du -sh ${{ env.BASEDIR }}/target_ws
57 changes: 57 additions & 0 deletions .github/workflows/build-rolling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: Build rolling
on:
pull_request:
push:
branches:
- ros2-master
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '28 6 * * *'

jobs:
binary:
name: binary build
runs-on: ubuntu-latest
strategy:
matrix:
env:
- {ROS_DISTRO: rolling, ROS_REPO: main}
- {ROS_DISTRO: rolling, ROS_REPO: testing}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
BASEDIR: ${{ github.workspace }}/.work
CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
DOWNSTREAM_WORKSPACE: https://raw.githubusercontent.com/ros-controls/ros2_control/master/ros2_control/ros2_control.repos
steps:
- uses: actions/checkout@v1
# The target directory cache doesn't include the source directory because
# that comes from the checkout. See "prepare target_ws for cache" task below
- name: cache target_ws
if: ${{ ! matrix.env.CCOV }}
uses: pat-s/[email protected]
with:
path: ${{ env.BASEDIR }}/target_ws
key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }}
restore-keys: |
target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}
- name: cache ccache
uses: pat-s/[email protected]
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
ccache-${{ env.CACHE_PREFIX }}
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
- name: prepare target_ws for cache
if: ${{ always() && ! matrix.env.CCOV }}
run: |
du -sh ${{ env.BASEDIR }}/target_ws
sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
sudo rm -rf ${{ env.BASEDIR }}/target_ws/src
du -sh ${{ env.BASEDIR }}/target_ws
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Test control_toolbox
name: Build Source foxy
on:
pull_request:
push:
branches:
- ros2-master
- foxy-devel
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '17 8 * * *'
# Run every day to detect flakiness and broken dependencies
- cron: '28 3 * * *'

jobs:
build_and_test:
runs-on: ubuntu-18.04
source:
name: source build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: ros-tooling/setup-ros@v0.1
- uses: ros-tooling/action-ros-ci@v0.1
- uses: ros-tooling/setup-ros@0.0.26
- uses: ros-tooling/action-ros-ci@0.2
with:
vcs-repo-file-url: |
https://raw.githubusercontent.com/ros-controls/control_toolbox/ros2-master/control_toolbox.rosinstall
Expand All @@ -24,14 +24,6 @@ jobs:
colcon-mixin-name: coverage-gcc
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
target-ros2-distro: foxy
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ros_ws/lcov/total_coverage.info
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
- uses: actions/upload-artifact@v1
with:
name: colcon-logs-${{ matrix.os }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/build-source-galactic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build Source galactic
on:
push:
branches:
- ros2-master
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '28 3 * * *'

jobs:
source:
name: source build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
with:
vcs-repo-file-url: |
https://raw.githubusercontent.com/ros-controls/control_toolbox/ros2-master/control_toolbox.rosinstall
https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos
package-name: control_toolbox
colcon-mixin-name: coverage-gcc
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
target-ros2-distro: galactic
- uses: actions/upload-artifact@v1
with:
name: colcon-logs-${{ matrix.os }}
path: ros_ws/log

30 changes: 30 additions & 0 deletions .github/workflows/build-source-rollling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Source rolling
on:
push:
branches:
- ros2-master
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '28 3 * * *'

jobs:
source:
name: source build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
with:
vcs-repo-file-url: |
https://raw.githubusercontent.com/ros-controls/control_toolbox/ros2-master/control_toolbox.rosinstall
https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos
package-name: control_toolbox
colcon-mixin-name: coverage-gcc
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
target-ros2-distro: rolling
- uses: actions/upload-artifact@v1
with:
name: colcon-logs-${{ matrix.os }}
path: ros_ws/log
25 changes: 25 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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:
push:
branches:
- ros2-master

jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install clang-format-10
run: sudo apt-get install clang-format-10 cppcheck
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual
token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 0 additions & 30 deletions .github/workflows/lint.yml

This file was deleted.

Loading

0 comments on commit 02b70e3

Please sign in to comment.