@@ -33,36 +33,17 @@ jobs:
3333 # https://stackoverflow.com/a/41673702
3434 CXXFLAGS : >-
3535 -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls -Wno-unknown-warning-option
36- CLANG_TIDY_ARGS : --fix --fix-errors --format-style=file
37- UPSTREAM_WORKSPACE : >
38- moveit2.repos
39- $(f="moveit2_$(sed 's/-.*$//' <<< "${{ matrix.env.IMAGE }}").repos"; test -r $f && echo $f)
40- # Pull any updates to the upstream workspace (after restoring it from cache)
41- AFTER_SETUP_UPSTREAM_WORKSPACE : vcs pull $BASEDIR/upstream_ws/src
42- AFTER_SETUP_DOWNSTREAM_WORKSPACE : vcs pull $BASEDIR/downstream_ws/src
43- # Clear the ccache stats before and log the stats after the build
44- AFTER_SETUP_CCACHE : ccache --zero-stats --max-size=10.0G
45- BEFORE_BUILD_UPSTREAM_WORKSPACE : ccache -z
46- AFTER_BUILD_TARGET_WORKSPACE : ccache -s
4736 # Changing linker to lld as ld has a behavior where it takes a long time to finish
37+ CMAKE_EXE_LINKER_FLAGS : -fuse-ld=lld
38+ CMAKE_SHARED_LINKER_FLAGS : -fuse-ld=lld
39+ CMAKE_MODULE_LINKER_FLAGS : -fuse-ld=lld
4840 # Compile CCOV with Debug. Enable -Werror.
49- TARGET_CMAKE_ARGS : >
50- -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld
51- -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld
52- -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld
53- -DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'Debug' || 'Release'}}
54- -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS${{ matrix.env.CCOV && ' --coverage -O2 -fno-omit-frame-pointer' || ''}}"
55- UPSTREAM_CMAKE_ARGS : " -DCMAKE_CXX_FLAGS=''"
56- DOWNSTREAM_CMAKE_ARGS : -DCMAKE_CXX_FLAGS="-Wall -Wextra"
41+ CMAKE_BUILD_TYPE : ${{ matrix.env.CCOV && 'Debug' || 'Release'}}
42+ CMAKE_CXX_FLAGS : " -Werror $CXXFLAGS${{ matrix.env.CCOV && ' --coverage -O2 -fno-omit-frame-pointer' || ''}}"
43+ CMAKE_CXX_COMPILER_LAUNCHER : ccache
5744 CCACHE_DIR : ${{ github.workspace }}/.ccache
5845 BASEDIR : ${{ github.workspace }}/.work
5946 CLANG_TIDY_BASE_REF : ${{ github.event_name != 'workflow_dispatch' && (github.base_ref || github.ref) || '' }}
60- BEFORE_CLANG_TIDY_CHECKS : |
61- # Show list of applied checks
62- (cd $TARGET_REPO_PATH; clang-tidy --list-checks)
63- # Disable clang-tidy for ikfast plugins as we cannot fix the generated code
64- find $BASEDIR/target_ws/build -iwholename "*_ikfast_plugin/compile_commands.json" -exec rm {} \;
65- find $BASEDIR/target_ws/build -iwholename "*_ikfast_manipulator_plugin/compile_commands.json" -exec rm {} \;
6647 CC : ${{ matrix.env.CLANG_TIDY && 'clang' }}
6748 CXX : ${{ matrix.env.CLANG_TIDY && 'clang++' }}
6849 ADDITIONAL_DEBS : lld
@@ -71,45 +52,28 @@ jobs:
7152 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)') || '' }}
7253 runs-on : ubuntu-latest
7354 container : moveit/moveit2:${{ matrix.env.IMAGE }}
55+ defaults :
56+ run :
57+ shell : bash
7458 steps :
7559 - uses : actions/checkout@v6
76- # NOTE: Testspace is temporarily disabled and needs to be installed for the MoveIt org
77- # See: https://github.com/moveit/moveit2/issues/2852
78- # - uses: testspace-com/setup-testspace@v1
79- # if: github.repository == 'moveit/moveit2'
80- # with:
81- # domain: moveit
60+ with :
61+ # checkout into a "src" directory so we look like a ROS workspace
62+ path : src
8263 - name : Get latest release date for rosdistro
8364 id : rosdistro_release_date
8465 uses : JafarAbdi/latest-rosdistro-release-date-action@main
8566 with :
8667 rosdistro : ${{ matrix.env.ROS_DISTRO }}
87- - name : Get latest timestamp repos file has been edited
88- id : repos_edit_timestamp
89- uses : vatanaksoytezer/latest-file-edit-timestamp-action@main
90- with :
91- file : moveit2.repos
92- - name : Cache upstream workspace
68+ - name : Cache build
9369 uses : rhaschke/cache@main
9470 with :
95- path : ${{ env.BASEDIR }}/upstream_ws
71+ path : ${{ env.BASEDIR }}/build
9672 key : ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
9773 restore-keys : ${{ env.CACHE_PREFIX }}
9874 env :
9975 GHA_CACHE_SAVE : always
100- 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') }}
101- # The target directory cache doesn't include the source directory because
102- # that comes from the checkout. See "prepare target_ws for cache" task below
103- - name : Cache target workspace
104- if : " !matrix.env.CCOV"
105- uses : rhaschke/cache@main
106- with :
107- path : ${{ env.BASEDIR }}/target_ws
108- key : ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
109- restore-keys : ${{ env.CACHE_PREFIX }}
110- env :
111- GHA_CACHE_SAVE : always
112- CACHE_PREFIX : target_ws${{ matrix.env.CCOV && '-ccov' || '' }}-${{ matrix.env.IMAGE }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml', '.github/workflows/ci.yaml') }}
76+ CACHE_PREFIX : build${{ matrix.env.CCOV && '-ccov' || '' }}-${{ matrix.env.IMAGE }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml', '.github/workflows/ci.yaml') }}
11377 - name : Cache ccache
11478 uses : rhaschke/cache@main
11579 with :
@@ -121,65 +85,50 @@ jobs:
12185 env :
12286 GHA_CACHE_SAVE : always
12387 CACHE_PREFIX : ccache-${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}
124- - name : Configure ccache
125- run : |
126- mkdir -p ${{ env.CCACHE_DIR }}
127- cp .github/ccache.conf ${{ env.CCACHE_DIR }}/ccache.conf
88+ - name : Configure ccache and rezero its stats
89+ run : ccache --zero-stats --max-size 10.0G
90+ - name : vcs import
91+ run : vcs import < moveit2.repos
92+ working-directory : src
12893 - name : Generate ikfast packages
12994 if : matrix.env.IKFAST_TEST
13095 run : moveit_kinematics/test/test_ikfast_plugins.sh
131- - id : ici
132- name : Run industrial_ci
133- uses : ros-industrial/industrial_ci@master
134- env :
135- CCOV : ${{ matrix.env.CCOV }}
136- CLANG_TIDY : ${{ matrix.env.CLANG_TIDY }}
137- ROS_DISTRO : ${{ matrix.env.ROS_DISTRO }}
138- # NOTE: Testspace is temporarily disabled and needs to be installed for the MoveIt org
139- # See: https://github.com/moveit/moveit2/issues/2852
140- # - name: Push result to Testspace
141- # if: always() && (github.repository == 'moveit/moveit2')
142- # run: |
143- # testspace "[ ${{ matrix.env.IMAGE }} ]${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml"
144- - name : Upload test artifacts (on failure)
96+ working-directory : src
97+ - name : Build workspace
98+ run : source /opt/ros/${{ matrix.env.ROS_DISTRO }}/setup.bash && colcon build
99+ - name : Test workspace
100+ run : source /opt/ros/${{ matrix.env.ROS_DISTRO }}/setup.bash && colcon test --return-code-on-test-failure
101+ - name : Show failed tests
102+ if : failure()
103+ run : colcon test-result
104+ - name : clang-tidy
105+ if : matrix.env.CLANG_TIDY
106+ run : run-clang-tidy -p build/ src
107+ - name : Upload test artifacts
145108 uses : actions/upload-artifact@v5
146- if : failure() && (steps.ici.outputs.run_target_test || steps.ici.outputs.target_test_results )
109+ if : always( )
147110 with :
148111 name : test-results-${{ matrix.env.IMAGE }}
149112 path : ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
150113 overwrite : true
151114 - name : Generate codecov report
152115 uses : rhaschke/lcov-action@main
153- if : always() && matrix.env.CCOV && steps.ici.outputs.target_test_results == '0'
116+ if : always() && matrix.env.CCOV
154117 with :
155118 workdir : ${{ env.BASEDIR }}/target_ws
156119 lcov_capture_args : --ignore-errors=gcov,gcov,mismatch,mismatch,negative,negative
157- ignore : ' "*/target_ws/ build/*" "*/target_ws/ install/*" "*/test/*"'
120+ ignore : ' "build/*" "install/*" "*/test/*"'
158121 - name : Upload codecov report
159122 uses : codecov/codecov-action@v5
160- if : always() && matrix.env.CCOV && steps.ici.outputs.target_test_results == '0'
123+ if : always() && matrix.env.CCOV
161124 with :
162- files : ${{ env.BASEDIR }}/target_ws/coverage.info
163- - name : Upload clang-tidy changes
164- uses : rhaschke/upload-git-patch-action@main
165- if : always() && matrix.env.CLANG_TIDY
166- with :
167- name : clang-tidy
168- path : ${{ env.BASEDIR }}/target_ws/src/$(basename $(pwd))
125+ files : ${{ env.BASEDIR }}/coverage.info
169126 - name : SonarQube Scan
170127 # Don't run if SONAR_TOKEN is not set (i.e. PR job from a fork)
171- if : matrix.env.CCOV && steps.ici.outputs.target_test_results == '0' && env.SONAR_TOKEN != ''
128+ if : matrix.env.CCOV && env.SONAR_TOKEN != ''
172129 uses : SonarSource/sonarqube-scan-action@v6.0.0
173130 with :
174131 projectBaseDir : ${{ env.BASEDIR }}/target_ws
175-
176- - name : Prepare target_ws for cache
177- if : always() && !matrix.env.CCOV
178- run : |
179- du -sh ${{ env.BASEDIR }}/target_ws
180- sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
181- sudo rm -rf ${{ env.BASEDIR }}/target_ws/src
182- du -sh ${{ env.BASEDIR }}/target_ws
183132 docker :
184133 uses : ./.github/workflows/docker.yaml
185134 docker_lint :
0 commit comments