Skip to content
Closed
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
15 changes: 15 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
Language: Cpp
BasedOnStyle: Google

ColumnLimit: 100
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
BreakBeforeBraces: Allman
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
DerivePointerAlignment: false
PointerAlignment: Middle
ReflowComments: false
IncludeBlocks: Preserve
...
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Test ros2_control with binary install
name: Binary Build
on:
pull_request:
push:
Expand All @@ -9,8 +9,8 @@ on:
- cron: '17 8 * * *'

jobs:
ci_binary:
name: Foxy binary job
binary:
name: Foxy binary build
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -19,5 +19,5 @@ jobs:
- {ROS_DISTRO: foxy, ROS_REPO: testing}
steps:
- uses: actions/checkout@v1
- uses: ros-industrial/industrial_ci@master
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
name: Build & Test ros2_control with source-based setup
name: Coverage Build
on:
pull_request:
push:
branches:
- master
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '17 8 * * *'
# Run every day to detect flakiness and broken dependencies
- cron: '07 7 * * *'

jobs:
ci_source:
name: Foxy source job
coverage:
name: coverage 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
with:
required-ros-distributions: foxy
- uses: ros-tooling/action-ros-ci@v0.2
with:
target-ros2-distro: foxy
# build all packages listed in the meta package
Expand All @@ -28,11 +31,15 @@ jobs:
ros2_control
ros2_control_test_assets
vcs-repo-file-url: |
https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos
https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ros2_control/ros2_control.repos
colcon-mixin-name: coverage-gcc
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v1.0.14
with:
file: ros_ws/lcov/total_coverage.info
flags: unittests
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/ci-build-source.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Source Build
on:
push:
branches:
- master
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '27 7 * * *'

jobs:
source:
name: source build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: ros-tooling/setup-ros@0.0.26
- uses: ros-tooling/action-ros-ci@v0.2
with:
target-ros2-distro: foxy
# build all packages listed in the meta package
package-name:
controller_interface
controller_manager
controller_manager_msgs
hardware_interface
ros2controlcli
ros2_control
ros2_control_test_assets
vcs-repo-file-url: |
https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos
https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ros2_control/ros2_control.repos
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- uses: actions/upload-artifact@v1
with:
name: colcon-logs-${{ matrix.os }}
path: ros_ws/log
24 changes: 24 additions & 0 deletions .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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:
- 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/action@v2.0.2
with:
extra_args: --all-files --hook-stage manual
51 changes: 51 additions & 0 deletions .github/workflows/ci-ros-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: ROS Lint
on:
pull_request:

jobs:
ament_lint:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
linter: [copyright, cppcheck, lint_cmake]
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/setup-ros@v0.1
- uses: ros-tooling/action-ros-lint@v0.1
with:
distribution: foxy
linter: ${{ matrix.linter }}
package-name:
controller_interface
controller_manager
controller_manager_msgs
hardware_interface
ros2controlcli
ros2_control
ros2_control_test_assets

ament_lint_cpplint:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
linter: [cpplint]
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/setup-ros@v0.1
- uses: ros-tooling/action-ros-lint@v0.1
with:
distribution: foxy
linter: cpplint
arguments: "--filter=-whitespace/newline"
package-name:
controller_interface
controller_manager
controller_manager_msgs
hardware_interface
ros2controlcli
ros2_control
ros2_control_test_assets
28 changes: 0 additions & 28 deletions .github/workflows/lint.yml

This file was deleted.

143 changes: 143 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# To use:
#
# pre-commit run -a
#
# Or:
#
# pre-commit install # (runs every time you commit in git)
#
# To update this file:
#
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit

repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: fix-byte-order-marker

# Python hooks
- repo: https://github.com/asottile/pyupgrade
rev: v2.12.0
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
args: ["--line-length=100"]

# PEP 257
- repo: https://github.com/FalconSocial/pre-commit-mirrors-pep257
rev: v0.3.3
hooks:
- id: pep257
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]

- repo: https://github.com/pycqa/flake8
rev: 3.9.0
hooks:
- id: flake8
args: ["--ignore=E501"]

# CPP hooks
- repo: local
hooks:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format-10
language: system
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
args: ['-fallback-style=none', '-i']
# The same options as in ament_cppcheck are used, but its not working...
#- repo: https://github.com/pocc/pre-commit-hooks
#rev: v1.1.1
#hooks:
#- id: cppcheck
#args: ['--error-exitcode=1', '-f', '--inline-suppr', '-q', '-rp', '--suppress=internalAstError', '--suppress=unknownMacro', '--verbose']

- repo: local
hooks:
- id: ament_cppcheck
name: ament_cppcheck
description: Static code analysis of C/C++ files.
stages: [commit]
entry: ament_cppcheck
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$

# Maybe use https://github.com/cpplint/cpplint instead
- repo: local
hooks:
- id: ament_cpplint
name: ament_cpplint
description: Static code analysis of C/C++ files.
stages: [commit]
entry: ament_cpplint
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
args: ["--linelength=100", "--filter=-whitespace/newline"]

# Cmake hooks
- repo: local
hooks:
- id: ament_lint_cmake
name: ament_lint_cmake
description: Check format of CMakeLists.txt files.
stages: [commit]
entry: ament_lint_cmake
language: system
files: CMakeLists\.txt$

# Copyright
- repo: local
hooks:
- id: ament_copyright
name: ament_copyright
description: Check if copyright notice is available in all files.
stages: [commit]
entry: ament_copyright
language: system

# Docs - RestructuredText hooks
- repo: https://github.com/PyCQA/doc8
rev: 0.9.0a1
hooks:
- id: doc8
args: ['--max-line-length=100', '--ignore=D001']
exclude: CHANGELOG\.rst$

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0
hooks:
- id: rst-backticks
exclude: CHANGELOG\.rst$
- id: rst-directive-colons
- id: rst-inline-touching-normal

# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
hooks:
- id: codespell
args: ['--write-changes']
exclude: \.(svg|pyc)$