moveit_task_constructor/.github/workflows/ci.yaml
v4hn 924e733a42 use clang for clang-tidy job
And add warnings for gcc AND clang builds (as they can differ slightly).

Clang does not support -Wused-but-set-parameter yet, though
support is [on the way](https://reviews.llvm.org/D100581).
So this gets rid of this warning we see in CI:

> error: unknown warning option '-Wno-unused-but-set-parameter'; did you mean '-Wno-unused-parameter'?
2021-06-04 14:19:52 +02:00

81 lines
3.4 KiB
YAML

# 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: CI
on:
workflow_dispatch:
pull_request:
push:
jobs:
default:
strategy:
fail-fast: false
matrix:
env:
- IMAGE: melodic-source
NAME: ccov
TARGET_CMAKE_ARGS: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS="--coverage"
- IMAGE: master-source
CXXFLAGS: >-
-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls
-Wno-unused-parameter -Wno-unused-function -Wno-deprecated-copy -Wno-unused-but-set-parameter
- IMAGE: noetic-source
CXX: clang++
CLANG_TIDY: true
CXXFLAGS: >-
-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls
-Wno-unused-parameter -Wno-unused-function -Wno-deprecated-copy
- IMAGE: noetic-source
NAME: asan
DOCKER_RUN_OPTS: "-e PRELOAD=libasan.so.5"
TARGET_CMAKE_ARGS: -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer -O1"
env:
CATKIN_LINT: true
UNDERLAY: /root/ws_moveit/install
DOWNSTREAM_WORKSPACE: "github:ubi-agni/mtc_demos#master github:TAMS-Group/mtc_pour#master"
CCACHE_DIR: ${{ github.workspace }}/.ccache
BASEDIR: /home/runner/work
DOCKER_IMAGE: moveit/moveit:${{ matrix.env.IMAGE }}
CACHE_PREFIX: "${{ matrix.env.IMAGE }}${{ contains(matrix.env.TARGET_CMAKE_ARGS, '--coverage') && '-ccov' || '' }}"
# perform full clang-tidy check only on manual trigger (workflow_dispatch), PRs do check changed files, otherwise nothing
CLANG_TIDY_BASE_REF: ${{ github.event_name != 'workflow_dispatch' && (github.base_ref || github.ref) || '' }}
name: "${{ matrix.env.IMAGE }}${{ matrix.env.NAME && ' • ' || ''}}${{ matrix.env.NAME }}${{ matrix.env.CATKIN_LINT && ' • catkin_lint' || ''}}${{ matrix.env.CLANG_TIDY && ' • clang-tidy' || '' }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache ccache
uses: pat-s/always-upload-cache@v2.1.3
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 }}
- name: industrial_ci
uses: ros-industrial/industrial_ci@master
env: ${{ matrix.env || env }}
- name: Upload test artifacts (on failure)
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results
path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
- name: Collect coverage information
uses: rhaschke/lcov-action@master
if: ${{ contains(matrix.env.TARGET_CMAKE_ARGS, '--coverage') }}
with:
workdir: ${{ env.BASEDIR }}
dir: target_ws
ignore: '"/usr/*" "/opt/*" "/root/ws_moveit/*" "*/target_ws/build/*" "*/target_ws/install/*" "*/test/*"'
- name: Upload codecov report
uses: codecov/codecov-action@v1
if: ${{ contains(matrix.env.TARGET_CMAKE_ARGS, '--coverage') }}
with:
files: ${{ env.BASEDIR }}/coverage.info