@@ -18,29 +18,40 @@ jobs:
1818 env :
1919 - IMAGE : rolling-ci
2020 CCOV : true
21+ ROS_DISTRO : rolling
2122 - IMAGE : rolling-ci-testing
2223 IKFAST_TEST : true
23- - IMAGE : galactic-ci
24+ ROS_DISTRO : rolling
2425 CLANG_TIDY : pedantic
25- - IMAGE : galactic-ci-testing
2626 env :
2727 CXXFLAGS : " -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls -Wno-deprecated-copy"
28+ CLANG_TIDY_ARGS : --fix --fix-errors --format-style=file
2829 DOCKER_IMAGE : ghcr.io/ros-planning/moveit2:${{ matrix.env.IMAGE }}
2930 UPSTREAM_WORKSPACE : moveit2.repos $(f="moveit2_$(sed 's/-.*$//' <<< "${{ matrix.env.IMAGE }}").repos"; test -r $f && echo $f)
30- # TODO(#885): Fix circular test dependency with moveit_resources and remove it from the target workspace
31- TARGET_WORKSPACE : $TARGET_REPO_PATH github:ros-planning/moveit_resources#ros2
3231 # Pull any updates to the upstream workspace (after restoring it from cache)
3332 AFTER_SETUP_UPSTREAM_WORKSPACE : vcs pull $BASEDIR/upstream_ws/src
3433 AFTER_SETUP_DOWNSTREAM_WORKSPACE : vcs pull $BASEDIR/downstream_ws/src
34+ # Clear the ccache stats before and log the stats after the build
35+ BEFORE_BUILD_UPSTREAM_WORKSPACE : ccache -z
36+ AFTER_BUILD_TARGET_WORKSPACE : ccache -s
37+ # Changing linker to lld as ld has a behavior where it takes a long time to finish
3538 TARGET_CMAKE_ARGS : >
39+ -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld
40+ -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld
41+ -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld
3642 -DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'Debug' || 'Release'}}
3743 -DCMAKE_CXX_FLAGS="${{ matrix.env.CLANG_TIDY != 'pedantic' && '-Werror ' || '' }}${{ matrix.env.CCOV && ' --coverage -O2 -fno-omit-frame-pointer'}}"
3844 CCACHE_DIR : ${{ github.workspace }}/.ccache
3945 BASEDIR : ${{ github.workspace }}/.work
4046 CLANG_TIDY_BASE_REF : ${{ github.event_name != 'workflow_dispatch' && (github.base_ref || github.ref) || '' }}
41- BEFORE_CLANG_TIDY_CHECKS : (cd $TARGET_REPO_PATH; clang-tidy --list-checks)
47+ BEFORE_CLANG_TIDY_CHECKS : |
48+ # Show list of applied checks
49+ (cd $TARGET_REPO_PATH; clang-tidy --list-checks)
50+ # Disable clang-tidy for ikfast plugins as we cannot fix the generated code
51+ find $BASEDIR/target_ws/build -iwholename "*_ikfast_plugin/compile_commands.json" -exec rm {} \;
4252 CC : ${{ matrix.env.CLANG_TIDY && 'clang' }}
4353 CXX : ${{ matrix.env.CLANG_TIDY && 'clang++' }}
54+ ADDITIONAL_DEBS : lld
4455
4556 name : ${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && ' + ccov' || ''}}${{ matrix.env.IKFAST_TEST && ' + ikfast' || ''}}${{ matrix.env.CLANG_TIDY && (github.event_name != 'workflow_dispatch' && ' + clang-tidy (delta)' || ' + clang-tidy (all)') || '' }}
4657 runs-on : ubuntu-latest
@@ -60,14 +71,27 @@ jobs:
6071 sudo rm -rf /usr/local
6172 df -h
6273 - uses : actions/checkout@v2
74+ - uses : testspace-com/setup-testspace@v1
75+ with :
76+ domain : ros-planning
77+ - name : Get latest release date for rosdistro
78+ id : rosdistro_release_date
79+ uses : JafarAbdi/latest-rosdistro-release-date-action@main
80+ with :
81+ rosdistro : ${{ matrix.env.ROS_DISTRO }}
82+ - name : Get latest timestamp repos file has been edited
83+ id : repos_edit_timestamp
84+ uses : vatanaksoytezer/latest-file-edit-timestamp-action@main
85+ with :
86+ file : moveit2.repos
6387 - name : Cache upstream workspace
6488 uses : pat-s/always-upload-cache@v2.1.5
6589 with :
6690 path : ${{ env.BASEDIR }}/upstream_ws
6791 key : ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
6892 restore-keys : ${{ env.CACHE_PREFIX }}
6993 env :
70- CACHE_PREFIX : upstream_ws-${{ matrix.env.IMAGE }}-${{ hashFiles('moveit2*.repos', '.github/workflows/ci.yaml') }}
94+ CACHE_PREFIX : ${{ steps.rosdistro_release_date.outputs.date }}- upstream_ws-${{ steps.repos_edit_timestamp.outputs.timestamp }} -${{ matrix.env.IMAGE }}-${{ hashFiles('moveit2*.repos', '.github/workflows/ci.yaml') }}
7195 # The target directory cache doesn't include the source directory because
7296 # that comes from the checkout. See "prepare target_ws for cache" task below
7397 - name : Cache target workspace
@@ -89,15 +113,21 @@ jobs:
89113 ${{ env.CACHE_PREFIX }}
90114 env :
91115 CACHE_PREFIX : ccache-${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}
92-
116+ - name : Configure ccache
117+ run : |
118+ mkdir -p ${{ env.CCACHE_DIR }}
119+ cp .github/ccache.conf ${{ env.CCACHE_DIR }}/ccache.conf
93120 - name : Generate ikfast packages
94121 if : matrix.env.IKFAST_TEST
95122 run : moveit_kinematics/test/test_ikfast_plugins.sh
96123 - id : ici
97124 name : Run industrial_ci
98125 uses : ros-industrial/industrial_ci@master
99126 env : ${{ matrix.env }}
100-
127+ - name : Push result to Testspace
128+ if : always()
129+ run : |
130+ testspace "[ ${{ matrix.env.IMAGE }} ]${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml"
101131 - name : Upload test artifacts (on failure)
102132 uses : actions/upload-artifact@v2
103133 if : failure() && (steps.ici.outputs.run_target_test || steps.ici.outputs.target_test_results)
@@ -106,24 +136,24 @@ jobs:
106136 path : ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
107137 - name : Generate codecov report
108138 uses : rhaschke/lcov-action@main
109- if : matrix.env.CCOV && steps.ici.outputs.target_test_results == '0'
139+ if : always() && matrix.env.CCOV && steps.ici.outputs.target_test_results == '0'
110140 with :
111141 docker : $DOCKER_IMAGE
112142 workdir : ${{ env.BASEDIR }}/target_ws
113143 ignore : ' "*/target_ws/build/*" "*/target_ws/install/*" "*/test/*"'
114144 - name : Upload codecov report
115145 uses : codecov/codecov-action@v2
116- if : matrix.env.CCOV && steps.ici.outputs.target_test_results == '0'
146+ if : always() && matrix.env.CCOV && steps.ici.outputs.target_test_results == '0'
117147 with :
118148 files : ${{ env.BASEDIR }}/target_ws/coverage.info
119149 - name : Upload clang-tidy changes
120150 uses : rhaschke/upload-git-patch-action@main
121- if : matrix.env.CLANG_TIDY
151+ if : always() && matrix.env.CLANG_TIDY
122152 with :
123153 name : clang-tidy
124154 path : ${{ env.BASEDIR }}/target_ws/src/$(basename $(pwd))
125155 - name : Prepare target_ws for cache
126- if : " !matrix.env.CCOV"
156+ if : always() && !matrix.env.CCOV
127157 run : |
128158 du -sh ${{ env.BASEDIR }}/target_ws
129159 sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
0 commit comments