From 0c428c24d854cbbefbf363552704a22e6acf56d0 Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Mon, 22 Mar 2021 00:26:52 -0600 Subject: [PATCH 01/10] try caching whole workspaces --- .github/workflows/industrial_ci_action.yml | 43 +++++++++++++++------ README.md | 2 - warehouse_ros_mongo.repos => upstream.repos | 0 3 files changed, 31 insertions(+), 14 deletions(-) rename warehouse_ros_mongo.repos => upstream.repos (100%) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index ce0c764..546e37e 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -11,33 +11,52 @@ jobs: matrix: env: - { - ROS_DISTRO: foxy, ROS_REPO: main, CCOV_UPLOAD: true, + ROS_DISTRO: foxy, + ROS_REPO: main, + CCOV_UPLOAD: true, CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='--coverage' -DCMAKE_CXX_FLAGS='--coverage'", AFTER_RUN_TARGET_TEST: './.ci.prepare_codecov', - ADDITIONAL_DEBS: 'curl lcov grep' + ADDITIONAL_DEBS: 'lcov' + } + - { + ROS_DISTRO: foxy, + ROS_REPO: testing, + CCOV_UPLOAD: false } - - {ROS_DISTRO: foxy, ROS_REPO: testing, CCOV_UPLOAD: false} env: - UPSTREAM_WORKSPACE: warehouse_ros_mongo.repos - CCACHE_DIR: /home/runner/.ccache - BASEDIR: .base + UPSTREAM_WORKSPACE: upstream.repos + AFTER_SETUP_UPSTREAM_WORKSPACE: 'vcs pull $BASEDIR/upstream_ws/src' + CCACHE_DIR: "${{ github.workspace }}/.ccache" + BASEDIR: ${{ github.workspace }}/.work + CACHE_PREFIX: "${{ matrix.ROS_DISTRO }}-${{ matrix.ROS_REPO }}${{ matrix.CCOV_UPLOAD && '-ccov' || '' }}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - name: cache upstream_ws + uses: pat-s/always-upload-cache@v2.1.3 + with: + path: ${{ env.BASEDIR }}/upstream_ws + key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.repos') }}-${{ github.run_id }} + restore-keys: | + upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.repos') }} + - name: cache ccache + uses: pat-s/always-upload-cache@v2.1.3 with: path: ${{ env.CCACHE_DIR }} - key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}-${{ github.sha }} + key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} restore-keys: | - ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} - - uses: 'ros-industrial/industrial_ci@master' + ccache-${{ env.CACHE_PREFIX }} + - name: industrial_ci + uses: 'ros-industrial/industrial_ci@master' env: ${{ matrix.env }} - - uses: actions/upload-artifact@v2 + - 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 - - uses: codecov/codecov-action@v1 + - name: upload codecov report + uses: codecov/codecov-action@v1 if: ${{ matrix.env.CCOV_UPLOAD }} with: files: ${{ env.BASEDIR }}/coverage.info diff --git a/README.md b/README.md index fc25b78..9d34d3c 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ Code for persisting ROS message data using MongoDB. Contains C++ and Python lib [![Format](https://github.com/ros-planning/warehouse_ros_mongo/actions/workflows/format.yml/badge.svg?branch=ros2)](https://github.com/ros-planning/warehouse_ros_mongo/actions/workflows/format.yml?branch=ros2) [![BuildAndTest](https://github.com/ros-planning/warehouse_ros_mongo/actions/workflows/industrial_ci_action.yml/badge.svg?branch=ros2)](https://github.com/ros-planning/warehouse_ros_mongo/actions/workflows/industrial_ci_action.yml?branch=ros2) [![codecov](https://codecov.io/gh/ros-planning/warehouse_ros_mongo/branch/ros2/graph/badge.svg?token=W7uHKcY0ly)](https://codecov.io/gh/ros-planning/warehouse_ros_mongo) -[![Code Coverage Grid](https://codecov.io/gh/ros-planning/warehouse_ros_mongo/branch/ros2/graphs/tree.svg)](https://codecov.io/gh/ros-planning/warehouse_ros_mongo/branch/ros2/graphs/tree.svg) - ## Building from source ### ROS Jade / Kinetic diff --git a/warehouse_ros_mongo.repos b/upstream.repos similarity index 100% rename from warehouse_ros_mongo.repos rename to upstream.repos From ed1f4f6004aeabc606f15beb141acb9377bb39e6 Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Mon, 22 Mar 2021 14:46:34 -0600 Subject: [PATCH 02/10] add cache prefix --- .github/workflows/industrial_ci_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 546e37e..30d5a47 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -28,7 +28,7 @@ jobs: AFTER_SETUP_UPSTREAM_WORKSPACE: 'vcs pull $BASEDIR/upstream_ws/src' CCACHE_DIR: "${{ github.workspace }}/.ccache" BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: "${{ matrix.ROS_DISTRO }}-${{ matrix.ROS_REPO }}${{ matrix.CCOV_UPLOAD && '-ccov' || '' }}" + CACHE_PREFIX: "${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}${{ matrix.env.CCOV_UPLOAD && '-ccov' || '' }}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From b6172b85af96f6e6a3a7b982d8adc3ddc3540d36 Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Tue, 23 Mar 2021 13:27:56 -0600 Subject: [PATCH 03/10] test latest changes --- .ci.prepare_codecov | 2 + .github/workflows/industrial_ci_action.yml | 44 +++++++++++++++------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/.ci.prepare_codecov b/.ci.prepare_codecov index 5f9be81..9877d9c 100755 --- a/.ci.prepare_codecov +++ b/.ci.prepare_codecov @@ -4,6 +4,8 @@ pushd $BASEDIR BLUE='\033[0;34m' NOCOLOR='\033[0m' +apt-get -qq install lcov + echo -e "${BLUE}Capture coverage info${NOCOLOR}" lcov --capture --directory target_ws --output-file coverage.info diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 30d5a47..9162a81 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -11,24 +11,25 @@ jobs: matrix: env: - { - ROS_DISTRO: foxy, - ROS_REPO: main, - CCOV_UPLOAD: true, - CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS='--coverage' -DCMAKE_CXX_FLAGS='--coverage'", - AFTER_RUN_TARGET_TEST: './.ci.prepare_codecov', - ADDITIONAL_DEBS: 'lcov' - } + IMAGE: 'foxy-ci', + CCOV: true, + AFTER_RUN_TARGET_TEST: './.ci.prepare_codecov' + } - { - ROS_DISTRO: foxy, - ROS_REPO: testing, - CCOV_UPLOAD: false + IMAGE: 'foxy-ci-testing', } env: + DOCKER_IMAGE: moveit/moveit2:${{ matrix.env.IMAGE }} UPSTREAM_WORKSPACE: upstream.repos + CCOV: ${{ matrix.env.CCOV }} AFTER_SETUP_UPSTREAM_WORKSPACE: 'vcs pull $BASEDIR/upstream_ws/src' + TARGET_CMAKE_ARGS: > + -DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'Debug' || 'Release'}} + ${{ matrix.env.CCOV && '-DCMAKE_CXX_FLAGS="--coverage" --no-warn-unused-cli' || '' }} CCACHE_DIR: "${{ github.workspace }}/.ccache" BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: "${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}${{ matrix.env.CCOV_UPLOAD && '-ccov' || '' }}" + CACHE_PREFIX: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}" + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -39,12 +40,20 @@ jobs: key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.repos') }}-${{ github.run_id }} restore-keys: | upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.repos') }} + - name: cache target_ws + uses: pat-s/always-upload-cache@v2.1.3 + with: + path: ${{ env.BASEDIR }}/target_ws + key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/package.xml') }}-${{ github.run_id }} + restore-keys: | + target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/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 }} + 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' @@ -57,6 +66,15 @@ jobs: path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml - name: upload codecov report uses: codecov/codecov-action@v1 - if: ${{ matrix.env.CCOV_UPLOAD }} + if: ${{ env.CCOV }} with: files: ${{ env.BASEDIR }}/coverage.info + - name: prepare target_ws for cache + if: always() + run: | + sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcov' -type f -delete + sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcno' -type f -delete + sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcda' -type f -delete + sudo find ${{ env.BASEDIR }}/target_ws -name '*/test_results*' -delete + sudo rm -rf ${{ env.BASEDIR }}/target_ws/src + du -sh ${{ env.BASEDIR }}/target_ws From 598a5215f42bb90326b93880eeb2cb428a2755b1 Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Tue, 23 Mar 2021 14:18:55 -0600 Subject: [PATCH 04/10] how much is deleted --- .github/workflows/industrial_ci_action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 9162a81..5032e16 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -72,6 +72,7 @@ jobs: - name: prepare target_ws for cache if: always() run: | + du -sh ${{ env.BASEDIR }}/target_ws sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcov' -type f -delete sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcno' -type f -delete sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcda' -type f -delete From ba638665c576da9fbd51f365f69523213dadba0b Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Tue, 23 Mar 2021 15:27:23 -0600 Subject: [PATCH 05/10] latest from moveit2 --- .github/workflows/industrial_ci_action.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 5032e16..a7e95bc 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -30,6 +30,7 @@ jobs: BASEDIR: ${{ github.workspace }}/.work CACHE_PREFIX: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}" + name: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && ' + ccov' || ''}}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -37,10 +38,11 @@ jobs: uses: pat-s/always-upload-cache@v2.1.3 with: path: ${{ env.BASEDIR }}/upstream_ws - key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.repos') }}-${{ github.run_id }} + key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('moveit2.repos') }}-${{ github.run_id }} restore-keys: | - upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.repos') }} + upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('moveit2.repos') }} - name: cache target_ws + if: ${{ ! env.CCOV }} uses: pat-s/always-upload-cache@v2.1.3 with: path: ${{ env.BASEDIR }}/target_ws @@ -70,12 +72,9 @@ jobs: with: files: ${{ env.BASEDIR }}/coverage.info - name: prepare target_ws for cache - if: always() - run: | + if: ${{ always() && ! env.CCOV }} + run: du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcov' -type f -delete - sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcno' -type f -delete - sudo find ${{ env.BASEDIR }}/target_ws -name '*.gcda' -type f -delete - sudo find ${{ env.BASEDIR }}/target_ws -name '*/test_results*' -delete + sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete sudo rm -rf ${{ env.BASEDIR }}/target_ws/src du -sh ${{ env.BASEDIR }}/target_ws From ef0760b096652d824e100b66c47e9b3608df9d09 Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Tue, 23 Mar 2021 17:00:44 -0600 Subject: [PATCH 06/10] clang-tidy --- .ci.clang_tidy | 101 +++++++++++++++++++++ .github/workflows/industrial_ci_action.yml | 9 +- 2 files changed, 107 insertions(+), 3 deletions(-) create mode 100755 .ci.clang_tidy diff --git a/.ci.clang_tidy b/.ci.clang_tidy new file mode 100755 index 0000000..9f18ee6 --- /dev/null +++ b/.ci.clang_tidy @@ -0,0 +1,101 @@ +#!/bin/bash + +# usage: echo -e $(colorize RED Some ${fancy} text.) +function colorize() { + local color reset + while true ; do + case "${1:-}" in + RED|GREEN|YELLOW|BLUE) + color="ANSI_$1"; eval "color=\$$color"; reset="${ANSI_RESET}" ;; + THIN) + color="${color:-}${ANSI_THIN}" ;; + BOLD) + color="${color:-}${ANSI_BOLD}"; reset="${reset:-${ANSI_THIN}}" ;; + *) break ;; + esac + shift + done + echo -e "${color:-}$@${reset:-}" +} + +# collect files that are modified since commit +function collect_modified_files() { + local -n __modified_files=$1 # -n to modify argument by reference + local filter=$2 + local src_dir=${3:-$PWD} + local base=${4:-$GITHUB_BASE_REF} + + # Find top-level git folder of src_dir + local strip_prefix=$(cd "$src_dir"; git rev-parse --show-toplevel) + # Strip git folder from src_dir to keep relative path from git root to source files as stip_prefix + strip_prefix="${src_dir#$strip_prefix/}" + while IFS='' read -r line ; do + # Add modified or added files to array - only using the relative path from src_dir, i.e. removing strip_prefix + __modified_files+=("${line#$strip_prefix/}") + done < <(git diff --name-only --diff-filter=MA "$base"..HEAD "$src_dir" | grep "$filter") +} + +run_clang_tidy_fix() { + local SOURCE_PKGS COMPILED_PKGS counter pkg file src_dir + SOURCE_PKGS=($(colcon list $BASEDIR/target_ws/src/$TARGET_REPO_NAME --only-names 2> /dev/null)) + + # filter repository packages for those which have a compile_commands.json file in their build folder + declare -A PKGS # associative array + for pkg in ${SOURCE_PKGS[@]} ; do + file="$BASEDIR/target_ws/build/$pkg/compile_commands.json" + test -r "$file" && PKGS[$pkg]=$(dirname "$file") + done + + for pkg in ${SOURCE_PKGS[@]} ; do # process files in topological order + test -z "${PKGS[$pkg]:-}" && continue # skip pkgs without compile_commands.json + echo -e $(colorize GREEN "start clang.tidy: $pkg") + + # Find all .cpp files in pkg's src_dir that were added or modified in this pull request + modified_files=() + if [ "${GITHUB_BASE_REF:-false}" != false ]; then + src_dir=$(grep "^CMAKE_HOME_DIRECTORY:INTERNAL=" "${PKGS[$pkg]}/CMakeCache.txt") + collect_modified_files modified_files "\.cpp$" $(realpath "${src_dir#*=}") $GITHUB_BASE_REF + if [ ${#modified_files[@]} -eq 0 ]; then + echo "No modified .cpp files" + continue + fi + fi + + clang-tidy-10 -fix -header-filter='$BASEDIR/target_ws/src/$TARGET_REPO_NAME/.*' -p "${PKGS[$pkg]}" ${modified_files[@]:-} 2> /dev/null + # if there are workspace changes, print broken pkg to file descriptor 3 + travis_have_fixes && 1>&3 echo $pkg || true # should always succeed ;-) + travis_fold end clang.tidy + done +} + +pushd $BASEDIR/target_ws/src/$TARGET_REPO_NAME + +sudo apt-get install -qq git clang-tidy-10 grep + +echo "*********** START *************" + +echo -e $(colorize BLUE "GITHUB_HEAD_REF = $GITHUB_HEAD_REF") +echo -e $(colorize BLUE "GITHUB_BASE_REF = $GITHUB_BASE_REF") + +# Ensure the base branch ($GITHUB_BASE_REF) is available +if [ "$(git rev-parse --abbrev-ref HEAD)" != "$GITHUB_BASE_REF" ] ; then + git fetch origin "$GITHUB_BASE_REF" + git branch -f "$GITHUB_BASE_REF" FETCH_HEAD +fi + +# Run run_clang_tidy_fix() and redirect file descriptor 3 to /tmp/clang-tidy.tainted to collect tainted pkgs +run_clang_tidy_fix 3>/tmp/clang-tidy.tainted +result=$? +test $result -ne 0 && exit $result + +# Read content of /tmp/clang-tidy.tainted into variable TAINTED_PKGS +TAINTED_PKGS=$(< /tmp/clang-tidy.tainted) + +if [ -z "$TAINTED_PKGS" ] ; then + echo -e $(colorize GREEN "Passed clang-tidy check") +else + echo -e "$(colorize RED \"clang-tidy check failed for the following packages:\")\\n$(colorize YELLOW $(colorize THIN $TAINTED_PKGS))" + exit 2 +fi + +popd diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index a7e95bc..df5fca5 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -17,6 +17,8 @@ jobs: } - { IMAGE: 'foxy-ci-testing', + EXPORT_COMPILE_COMMANDS: true, + AFTER_RUN_TARGET_TEST: './.ci.clang_tidy' } env: DOCKER_IMAGE: moveit/moveit2:${{ matrix.env.IMAGE }} @@ -24,13 +26,14 @@ jobs: CCOV: ${{ matrix.env.CCOV }} AFTER_SETUP_UPSTREAM_WORKSPACE: 'vcs pull $BASEDIR/upstream_ws/src' TARGET_CMAKE_ARGS: > - -DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'Debug' || 'Release'}} + -DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'RelWithDebInfo' || 'Release'}} ${{ matrix.env.CCOV && '-DCMAKE_CXX_FLAGS="--coverage" --no-warn-unused-cli' || '' }} + ${{ matrix.env.EXPORT_COMPILE_COMMANDS && '-DCMAKE_EXPORT_COMPILE_COMMANDS=1' || '' }} CCACHE_DIR: "${{ github.workspace }}/.ccache" BASEDIR: ${{ github.workspace }}/.work CACHE_PREFIX: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}" - name: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && ' + ccov' || ''}}" + name: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && ' + ccov' || ''}}${{ matrix.env.EXPORT_COMPILE_COMMANDS && ' + clang-tidy' || '' }}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -73,7 +76,7 @@ jobs: files: ${{ env.BASEDIR }}/coverage.info - name: prepare target_ws for cache if: ${{ always() && ! env.CCOV }} - run: + 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 From c48f6fc96d9d07605373707a67ef76d4c5e93132 Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Tue, 23 Mar 2021 17:11:59 -0600 Subject: [PATCH 07/10] don't mix styles --- .github/workflows/industrial_ci_action.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index df5fca5..aeb31c8 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -10,16 +10,12 @@ jobs: strategy: matrix: env: - - { - IMAGE: 'foxy-ci', - CCOV: true, + - IMAGE: 'foxy-ci' + CCOV: true AFTER_RUN_TARGET_TEST: './.ci.prepare_codecov' - } - - { - IMAGE: 'foxy-ci-testing', - EXPORT_COMPILE_COMMANDS: true, + - IMAGE: 'foxy-ci-testing' + EXPORT_COMPILE_COMMANDS: true AFTER_RUN_TARGET_TEST: './.ci.clang_tidy' - } env: DOCKER_IMAGE: moveit/moveit2:${{ matrix.env.IMAGE }} UPSTREAM_WORKSPACE: upstream.repos @@ -49,9 +45,9 @@ jobs: uses: pat-s/always-upload-cache@v2.1.3 with: path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/package.xml') }}-${{ github.run_id }} + key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/package.xml') }} + target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - name: cache ccache uses: pat-s/always-upload-cache@v2.1.3 with: From 8783a6ff4a49f6d1a0edfab38fbb1ef2af9975df Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Tue, 23 Mar 2021 17:16:19 -0600 Subject: [PATCH 08/10] try the format fails comment action --- .github/workflows/format.yml | 12 ++++++++++++ src/query_results.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index fa91702..471ce71 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -18,3 +18,15 @@ jobs: - name: Install clang-format-10 run: sudo apt-get install clang-format-10 - uses: pre-commit/action@v2.0.0 + - name: Comment on PR if checks fail + if: failure() + uses: actions/github-script@0.9.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'The format checks failed :(, Here are instructions for running pre-commit to fix the formatting: https://github.com/ros-planning/moveit2/wiki/pre-commit.' + }) diff --git a/src/query_results.cpp b/src/query_results.cpp index 880cb76..1e931b9 100644 --- a/src/query_results.cpp +++ b/src/query_results.cpp @@ -99,4 +99,4 @@ mongo::BSONObj MongoResultIterator::metadataRaw() const return next_->copy(); } -} // namespace warehouse_ros_mongo +} // warehouse_ros_mongo From cd18b8f5da67d71e651c5de63f530bcf3a14edc0 Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Tue, 23 Mar 2021 17:21:03 -0600 Subject: [PATCH 09/10] try different message --- .github/workflows/format.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 471ce71..0569977 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -20,13 +20,7 @@ jobs: - uses: pre-commit/action@v2.0.0 - name: Comment on PR if checks fail if: failure() - uses: actions/github-script@0.9.0 + uses: thollander/actions-comment-pull-request@master with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: 'The format checks failed :(, Here are instructions for running pre-commit to fix the formatting: https://github.com/ros-planning/moveit2/wiki/pre-commit.' - }) + message: 'The format checks failed :(, Here are instructions for running pre-commit to fix the formatting: https://github.com/ros-planning/moveit2/wiki/pre-commit' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7ee9447f2bdb2ed13d75e976ae9866c24b5a9dfd Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Tue, 23 Mar 2021 17:25:21 -0600 Subject: [PATCH 10/10] remove failed attempt to leave comment --- .github/workflows/format.yml | 6 ------ src/query_results.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 0569977..fa91702 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -18,9 +18,3 @@ jobs: - name: Install clang-format-10 run: sudo apt-get install clang-format-10 - uses: pre-commit/action@v2.0.0 - - name: Comment on PR if checks fail - if: failure() - uses: thollander/actions-comment-pull-request@master - with: - message: 'The format checks failed :(, Here are instructions for running pre-commit to fix the formatting: https://github.com/ros-planning/moveit2/wiki/pre-commit' - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/query_results.cpp b/src/query_results.cpp index 1e931b9..880cb76 100644 --- a/src/query_results.cpp +++ b/src/query_results.cpp @@ -99,4 +99,4 @@ mongo::BSONObj MongoResultIterator::metadataRaw() const return next_->copy(); } -} // warehouse_ros_mongo +} // namespace warehouse_ros_mongo