Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated CI to be based on tesseract_planning CI docker image #77

Merged
merged 9 commits into from
Jan 3, 2024
Merged
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
88 changes: 88 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
Checks: >
-*,
clang-diagnostic-*,
-clang-diagnostic-unknown-warning-option,
clang-analyzer-*,
-clang-analyzer-cplusplus*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
cppcoreguidelines-*,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-non-private-member-variables-in-classes,
misc-*,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
performance-*,
readability-*,
-readability-braces-around-statements,
-readability-named-parameter,
-readability-magic-numbers,
-readability-isolate-declaration,
-readability-function-cognitive-complexity,
-readability-use-anyofallof,
-readability-identifier-length,
-readability-suspicious-call-argument,
-readability-function-size
WarningsAsErrors: >
-*,
clang-diagnostic-*,
-clang-diagnostic-unknown-warning-option,
clang-analyzer-*,
-clang-analyzer-cplusplus*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
cppcoreguidelines-*,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-non-private-member-variables-in-classes,
misc-*,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
performance-*,
readability-*,
-readability-braces-around-statements,
-readability-named-parameter,
-readability-magic-numbers,
-readability-isolate-declaration,
-readability-function-cognitive-complexity
-readability-use-anyofallof,
-readability-identifier-length,
-readability-suspicious-call-argument,
-readability-function-size
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- key: modernize-use-override.AllowOverrideAndFinal
value: '1'
- key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal
value: '1'
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: '1'
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
value: '1'
ExtraArgs:
- '-std=c++17'
...
54 changes: 16 additions & 38 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,27 @@ on:
push:
branches:
- master
- 'dev**'
pull_request:
paths:
- 'tesseract**'
- '.github/workflows/clang_format.yml'
- '**clang-format'
schedule:
- cron: '0 5 * * *'

jobs:
industrial_ci:
name: Format
runs-on: ubuntu-latest
env:
CI_NAME: Clang-Format
OS_NAME: ubuntu
OS_CODE_NAME: focal
ROS_DISTRO: foxy
ROS_REPO: main
ROSDEP_SKIP_KEYS: "catkin taskflow"
DOCKER_IMAGE: "ros:foxy"
CLANG_FORMAT_CHECK: file
CLANG_FORMAT_VERSION: 10
clang_format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Free Disk Space
- name: Run clang format
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/[email protected]
with:
path: ${{ env.CI_NAME }}/.ccache
key: ${{ env.CI_NAME }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ env.CI_NAME }}-ccache-
- uses: 'ros-industrial/industrial_ci@master'
env: ${{env}}
sudo apt update
sudo apt install -y git clang-format
if [ $? -ge 1 ]; then return 1; fi
./.run-clang-format
if [ $? -ge 1 ]; then return 1; fi
output=$(git diff)
if [ -n "$output" ]; then exit 1; else exit 0; fi
60 changes: 0 additions & 60 deletions .github/workflows/clang_tidy.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Code Quality

on:
push:
branches:
- master
pull_request:
paths:
- 'tesseract**'
- '.github/workflows/code_quality.yml'
- '.clang-tidy'
schedule:
- cron: '0 5 * * *'

jobs:
ci:
name: ${{ matrix.job_type }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- os: jammy
distro: humble
env:
TARGET_CMAKE_ARGS: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DTESSERACT_ENABLE_CLANG_TIDY=ON -DTESSERACT_ENABLE_TESTING=ON"

container:
image: ghcr.io/tesseract-robotics/tesseract_qt:${{ matrix.os }}-0.21
env:
CCACHE_DIR: "${{ github.workspace }}/${{ matrix.os }}/.ccache"
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: target_ws/src

- name: Install Depends
shell: bash
run: |
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
apt update -qq
apt upgrade -y
apt install -y clang-tidy ros-${{ matrix.distro }}-ros-base

- name: Build and Tests
uses: tesseract-robotics/colcon-action@v5
with:
before-script: apt install ros-${{ matrix.distro }}-ros-base && source /opt/tesseract_qt/install/setup.bash && source /opt/ros/${{ matrix.distro }}/setup.bash
ccache-prefix: ${{ matrix.distro }}
vcs-file: .github/workflows/dependencies.repos
run-tests: false
target-path: target_ws/src
target-args: --cmake-args ${{ matrix.env.TARGET_CMAKE_ARGS }}
5 changes: 5 additions & 0 deletions .github/workflows/dependencies.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
octomap_msgs:
type: git
url: https://github.com/OctoMap/octomap_msgs.git
version: 67be62db91510f3a10ac6c37b1013307c290631c
Loading
Loading