diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000..5b8b3db --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,31 @@ +# 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: + +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 + - name: Install catkin-lint + run: | + lsb_release -sc + sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' + sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 + sudo apt-get -q update + sudo apt-get -q install python3-rosdep + sudo rosdep init + rosdep update + sudo apt-get -q install catkin-lint + export ROS_DISTRO=noetic + - uses: pre-commit/action@v2.0.0 diff --git a/.github/workflows/industrial_ci_action.yaml b/.github/workflows/industrial_ci_action.yaml new file mode 100644 index 0000000..851ff9e --- /dev/null +++ b/.github/workflows/industrial_ci_action.yaml @@ -0,0 +1,68 @@ +# 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: BuildAndTest + +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + +jobs: + industrial_ci: + strategy: + matrix: + env: + - ROS_DISTRO: noetic + ROS_REPO: main + CLANG_TIDY: true + - ROS_DISTRO: noetic + ROS_REPO: testing + env: + TARGET_CMAKE_ARGS: -DCMAKE_BUILD_TYPE=Release + CCACHE_DIR: ${{ github.workspace }}/.ccache + BASEDIR: ${{ github.workspace }}/.work + CACHE_PREFIX: "${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}${{ matrix.env.CCOV && '-ccov' || '' }}" + CLANG_TIDY: true + CLANG_TIDY_BASE_REF: "${{ github.base_ref || github.ref }}" + + name: "${{ matrix.env.ROS_DISTRO }} + ${{ matrix.env.ROS_REPO }}${{ matrix.env.CLANG_TIDY && ' + clang-tidy' || '' }}" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # 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/always-upload-cache@v2.1.3 + 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/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: 'tylerjw/industrial_ci@clang-tidy-modified-filter' + env: ${{ matrix.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: 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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..53e8565 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,56 @@ +# 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-case-conflict + - id: check-json + - id: check-merge-conflict + - id: check-symlinks + - id: check-toml + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: destroyed-symlinks + - id: detect-private-key + - id: end-of-file-fixer + - id: mixed-line-ending + - id: pretty-format-json + - id: trailing-whitespace + + - repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + + - 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'] + - id: catkin_lint + name: catkin_lint + description: Check package.xml and cmake files + entry: catkin_lint . + language: system + always_run: true + pass_filenames: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a84c12e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -# This config file for Travis CI utilizes https://github.com/ros-planning/moveit_ci package. -sudo: required -dist: xenial # distro used by Travis, moveit_ci uses the docker image's distro -services: - - docker -language: cpp -compiler: gcc -cache: ccache - -env: - global: - - ROS_DISTRO=noetic - - ROS_REPO=ros-testing - - CXXFLAGS="-Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" - - WARNINGS_OK=false - matrix: - - TEST="clang-format catkin_lint" - - TEST=clang-tidy-fix - - DOCKER_IMAGE=moveit/moveit:master-source ROS_REPO= - -before_script: - - git clone -q --depth=1 https://github.com/ros-planning/moveit_ci.git .moveit_ci - -script: - - .moveit_ci/travis.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b0544b..3c742f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,8 @@ add_library(${PROJECT_NAME} src/imarker_robot_state.cpp src/imarker_end_effector.cpp ) +target_compile_options(${PROJECT_NAME} PRIVATE + -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls) set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION}) add_dependencies(${PROJECT_NAME} graph_msgs_generate_messages_cpp) target_link_libraries(${PROJECT_NAME} @@ -62,6 +64,8 @@ target_link_libraries(${PROJECT_NAME} # Demo executable add_executable(${PROJECT_NAME}_demo src/${PROJECT_NAME}_demo.cpp) +target_compile_options(${PROJECT_NAME}_demo PRIVATE + -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls) target_link_libraries(${PROJECT_NAME}_demo ${catkin_LIBRARIES} ${PROJECT_NAME} ) diff --git a/README.md b/README.md index 01ef55a..0f50a5d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This open source project was developed at [PickNik Robotics](https://picknik.ai/ ## Status: -* [![Build Status](https://travis-ci.org/ros-planning/moveit_visual_tools.svg)](https://travis-ci.org/ros-planning/moveit_visual_tools) Travis CI +* [![Format](https://github.com/ros-planning/moveit_visual_tools/actions/workflows/format.yaml/badge.svg?branch=master)](https://github.com/ros-planning/moveit_visual_tools/actions/workflows/format.yaml?branch=master) [![BuildAndTest](https://github.com/ros-planning/moveit_visual_tools/actions/workflows/industrial_ci_action.yaml/badge.svg?branch=master)](https://github.com/ros-planning/moveit_visual_tools/actions/workflows/industrial_ci_action.yaml?branch=master) GitHub Actions * [![Build Status](http://build.ros.org/buildStatus/icon?job=Kbin_uX64__moveit_visual_tools__ubuntu_xenial_amd64__binary)](http://build.ros.org/view/Kbin_uX64/job/Kbin_uX64__moveit_visual_tools__ubuntu_xenial_amd64__binary/) ROS Buildfarm - AMD64 Xenial Debian Build - Ubuntu 16.04 LTS * [![Build Status](http://build.ros.org/buildStatus/icon?job=Kdev__moveit_visual_tools__ubuntu_xenial_amd64)](http://build.ros.org/view/Kdev/job/Kdev__moveit_visual_tools__ubuntu_xenial_amd64/) ROS Buildfarm - AMD64 Xenial Devel Build - Ubuntu 16.04 LTS * [![Build Status](http://build.ros.org/buildStatus/icon?job=Msrc_uB__moveit_visual_tools__ubuntu_bionic__source)](http://build.ros.org/job/Msrc_uB__moveit_visual_tools__ubuntu_bionic__source/) ROS Buildfarm - AMD64 Bionic Source Build - Ubuntu 18.04 LTS diff --git a/launch/debug_settings.gdb b/launch/debug_settings.gdb index 0a0cf47..33e6c29 100644 --- a/launch/debug_settings.gdb +++ b/launch/debug_settings.gdb @@ -1,2 +1,2 @@ set breakpoint pending on -break planning_scene.cpp:1600 \ No newline at end of file +break planning_scene.cpp:1600 diff --git a/mainpage.dox b/mainpage.dox index 871ce86..92d276c 100644 --- a/mainpage.dox +++ b/mainpage.dox @@ -11,4 +11,4 @@ \section Action Server for Generating Grasps - \link moveit_simple_grasps::GraspGeneratorServer \endlink -*/ \ No newline at end of file +*/