22
33on :
44 push :
5- branches : [" main" ]
5+ branches : [' main' ]
66 pull_request :
7- branches : ["**" ]
7+ branches : ['**' ]
88
99jobs :
1010 build :
@@ -22,13 +22,13 @@ jobs:
2222 uses : turtlebrowser/get-conan@main
2323 with :
2424 version : 2.3.2
25-
25+
2626 - name : Install conan CI profile
2727 shell : bash
2828 run : |
2929 conan profile detect
3030 cp up-transport-zenoh-cpp/.github/workflows/ci_conan_profile "$(conan profile path default)"
31- conan profile show
31+ conan profile show
3232
3333 - name : Fetch up-core-api conan recipe
3434 uses : actions/checkout@v4
4949 - name : Build zenohcpp conan package
5050 shell : bash
5151 run : |
52- conan create --version 1.0.0-rc5 up-conan-recipes/zenohc-tmp/prebuilt
53- conan create --version 1.0.0-rc5 up-conan-recipes/zenohcpp-tmp/from-source
52+ conan create --version 1.2.1 up-conan-recipes/zenohc-tmp/prebuilt
53+ conan create --version 1.2.1 up-conan-recipes/zenohcpp-tmp/from-source
5454
5555 - name : Build up-transport-zenoh-cpp with tests
5656 shell : bash
@@ -119,6 +119,11 @@ jobs:
119119 needs : build
120120
121121 steps :
122+ - name : Fetch up-transport-zenoh-cpp
123+ uses : actions/checkout@v4
124+ with :
125+ path : up-transport-zenoh-cpp
126+
122127 - name : Get build commands
123128 uses : actions/download-artifact@v4
124129 with :
@@ -130,8 +135,12 @@ jobs:
130135 with :
131136 version : 2.3.2
132137
133- - name : Create default Conan profile
134- run : conan profile detect
138+ - name : Install conan CI profile
139+ shell : bash
140+ run : |
141+ conan profile detect
142+ cp up-transport-zenoh-cpp/.github/workflows/ci_conan_profile "$(conan profile path default)"
143+ conan profile show
135144
136145 - name : Get conan cache
137146 uses : actions/download-artifact@v4
@@ -143,11 +152,6 @@ jobs:
143152 run : |
144153 conan cache restore conan-cache.tgz
145154
146- - name : Fetch up-transport-zenoh-cpp
147- uses : actions/checkout@v4
148- with :
149- path : up-transport-zenoh-cpp
150-
151155 - name : Run linters on source
152156 id : source-linter
153157 uses : cpp-linter/cpp-linter-action@v2
@@ -161,7 +165,6 @@ jobs:
161165 database : compile_commands.json
162166 version : 12
163167
164-
165168 - name : Run linters on tests
166169 id : test-linter
167170 uses : cpp-linter/cpp-linter-action@v2
@@ -176,95 +179,97 @@ jobs:
176179 version : 12
177180
178181 - name : Report lint failure
179- if : steps.source-linter.outputs.checks-failed > 0 || steps.test-linter.outputs.checks-failed > 0
182+ if :
183+ steps.source-linter.outputs.checks-failed > 0 ||
184+ steps.test-linter.outputs.checks-failed > 0
180185 run : |
181186 exit 1
182187
183188 memcheck :
184- name : Run Valgrind Memcheck
185- runs-on : ubuntu-22.04
186- needs : build
187-
188- steps :
189- - name : Get build artifacts
190- uses : actions/download-artifact@v4
191- with :
192- name : build-artifacts
193- path : up-transport-zenoh-cpp
194-
195- - name : Install Valgrind
196- run : |
197- sudo apt-get update
198- sudo apt-get install -y valgrind
199-
200- - name : Run Valgrind Memcheck
201- continue-on-error : true
202- run : |
203- cd up-transport-zenoh-cpp/build/Release
204- touch valgrind_exclude_test_memcheck.txt
205- chmod +x bin/*
206- mkdir -p valgrind_logs
207- : > valgrind_logs/valgrind_memcheck_summary.log
208- declare -A EXCLUDE_TESTS
209- while IFS= read -r line; do
210- test_binary=$(echo $line | cut -d'.' -f1)
211- test_suite=$(echo $line | cut -d'.' -f2)
212- test_name=$(echo $line | cut -d'.' -f3)
213- if [[ -z "${EXCLUDE_TESTS["$test_binary"]}" ]]; then
214- EXCLUDE_TESTS["$test_binary"]="-"
215- else
216- EXCLUDE_TESTS["$test_binary"]+=":"
217- fi
218- EXCLUDE_TESTS["$test_binary"]+="$test_suite.$test_name"
219- done < valgrind_exclude_test_memcheck.txt
220-
221- for test_binary in bin/*Test; do
222- test_binary_name=$(basename $test_binary)
223- echo "Running Valgrind on $test_binary_name"
224- if [[ -n "${EXCLUDE_TESTS[$test_binary_name]}" ]]; then
225- exclude_pattern="${EXCLUDE_TESTS[$test_binary_name]}"
226- valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file="valgrind_logs/$test_binary_name.log" ./$test_binary --gtest_filter="$exclude_pattern" || true
227- else
228- valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file="valgrind_logs/$test_binary_name.log" ./$test_binary || true
229- fi
230-
231- cat "valgrind_logs/$test_binary_name.log" >> valgrind_logs/valgrind_complete_memcheck_log.log
232-
233- if grep -q "ERROR SUMMARY: [^0]" "valgrind_logs/$test_binary_name.log"; then
234- echo "Valgrind errors found in $test_binary_name:"
235- grep -A1 "ERROR SUMMARY:" "valgrind_logs/$test_binary_name.log" >> valgrind_logs/valgrind_memcheck_summary.log
236- echo "Valgrind log for $test_binary_name:"
237- cat "valgrind_logs/$test_binary_name.log"
238- echo "------------------------"
239- fi
240- done
241- echo "Valgrind Memcheck Summary:"
242- cat valgrind_logs/valgrind_memcheck_summary.log
243-
244- - name : Upload Valgrind Memcheck logs
245- uses : actions/upload-artifact@v4
246- if : success() || failure()
247- with :
248- name : valgrind-memcheck-log
249- path : up-transport-zenoh-cpp/build/Release/valgrind_logs/valgrind_complete_memcheck_log.log
189+ name : Run Valgrind Memcheck
190+ runs-on : ubuntu-22.04
191+ needs : build
192+
193+ steps :
194+ - name : Get build artifacts
195+ uses : actions/download-artifact@v4
196+ with :
197+ name : build-artifacts
198+ path : up-transport-zenoh-cpp
199+
200+ - name : Install Valgrind
201+ run : |
202+ sudo apt-get update
203+ sudo apt-get install -y valgrind
204+
205+ - name : Run Valgrind Memcheck
206+ continue-on-error : true
207+ run : |
208+ cd up-transport-zenoh-cpp/build/Release
209+ touch valgrind_exclude_test_memcheck.txt
210+ chmod +x bin/*
211+ mkdir -p valgrind_logs
212+ : > valgrind_logs/valgrind_memcheck_summary.log
213+ declare -A EXCLUDE_TESTS
214+ while IFS= read -r line; do
215+ test_binary=$(echo $line | cut -d'.' -f1)
216+ test_suite=$(echo $line | cut -d'.' -f2)
217+ test_name=$(echo $line | cut -d'.' -f3)
218+ if [[ -z "${EXCLUDE_TESTS["$test_binary"]}" ]]; then
219+ EXCLUDE_TESTS["$test_binary"]="-"
220+ else
221+ EXCLUDE_TESTS["$test_binary"]+=":"
222+ fi
223+ EXCLUDE_TESTS["$test_binary"]+="$test_suite.$test_name"
224+ done < valgrind_exclude_test_memcheck.txt
225+
226+ for test_binary in bin/*Test; do
227+ test_binary_name=$(basename $test_binary)
228+ echo "Running Valgrind on $test_binary_name"
229+ if [[ -n "${EXCLUDE_TESTS[$test_binary_name]}" ]]; then
230+ exclude_pattern="${EXCLUDE_TESTS[$test_binary_name]}"
231+ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file="valgrind_logs/$test_binary_name.log" ./$test_binary --gtest_filter="$exclude_pattern" || true
232+ else
233+ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file="valgrind_logs/$test_binary_name.log" ./$test_binary || true
234+ fi
235+
236+ cat "valgrind_logs/$test_binary_name.log" >> valgrind_logs/valgrind_complete_memcheck_log.log
237+
238+ if grep -q "ERROR SUMMARY: [^0]" "valgrind_logs/$test_binary_name.log"; then
239+ echo "Valgrind errors found in $test_binary_name:"
240+ grep -A1 "ERROR SUMMARY:" "valgrind_logs/$test_binary_name.log" >> valgrind_logs/valgrind_memcheck_summary.log
241+ echo "Valgrind log for $test_binary_name:"
242+ cat "valgrind_logs/$test_binary_name.log"
243+ echo "------------------------"
244+ fi
245+ done
246+ echo "Valgrind Memcheck Summary:"
247+ cat valgrind_logs/valgrind_memcheck_summary.log
248+
249+ - name : Upload Valgrind Memcheck logs
250+ uses : actions/upload-artifact@v4
251+ if : success() || failure()
252+ with :
253+ name : valgrind-memcheck-log
254+ path : up-transport-zenoh-cpp/build/Release/valgrind_logs/valgrind_complete_memcheck_log.log
250255
251256 threadcheck :
252257 name : Run Valgrind ThreadCheck
253258 runs-on : ubuntu-22.04
254259 needs : build
255-
260+
256261 steps :
257262 - name : Get build artifacts
258263 uses : actions/download-artifact@v4
259264 with :
260265 name : build-artifacts
261- path : up-transport-zenoh-cpp
262-
266+ path : up-transport-zenoh-cpp
267+
263268 - name : Install Valgrind
264269 run : |
265270 sudo apt-get update
266271 sudo apt-get install -y valgrind
267-
272+
268273 - name : Run Valgrind ThreadCheck
269274 continue-on-error : true
270275 run : |
@@ -286,7 +291,7 @@ jobs:
286291 fi
287292 EXCLUDE_TESTS["$test_binary"]+="$test_suite.$test_name"
288293 done < valgrind_exclude_test_threadcheck.txt
289-
294+
290295 for test_binary in bin/*Test; do
291296 test_binary_name=$(basename $test_binary)
292297 echo "Running Valgrind ThreadCheck on $test_binary_name"
@@ -296,9 +301,9 @@ jobs:
296301 else
297302 valgrind --tool=drd --log-file="valgrind_logs/$test_binary_name_threadcheck.log" ./$test_binary || true
298303 fi
299-
304+
300305 cat "valgrind_logs/$test_binary_name_threadcheck.log" >> valgrind_logs/valgrind_complete_threadcheck_log.log
301-
306+
302307 if grep -q "ERROR SUMMARY: [^0]" "valgrind_logs/$test_binary_name_threadcheck.log"; then
303308 echo "Valgrind ThreadCheck errors found in $test_binary_name:"
304309 grep -A1 "ERROR SUMMARY:" "valgrind_logs/$test_binary_name_threadcheck.log" >> valgrind_logs/valgrind_threadcheck_summary.log
@@ -307,34 +312,34 @@ jobs:
307312 echo "------------------------"
308313 fi
309314 done
310-
315+
311316 echo "Valgrind ThreadCheck Summary:"
312317 cat valgrind_logs/valgrind_threadcheck_summary.log
313-
318+
314319 - name : Upload Valgrind ThreadCheck logs
315320 uses : actions/upload-artifact@v4
316321 if : success() || failure()
317322 with :
318323 name : valgrind-threadcheck-log
319- path : up-transport-zenoh-cpp/build/Release/valgrind_logs/valgrind_complete_threadcheck_log.log
320-
324+ path : up-transport-zenoh-cpp/build/Release/valgrind_logs/valgrind_complete_threadcheck_log.log
325+
321326 helgrind :
322327 name : Run Valgrind Helgrind
323328 runs-on : ubuntu-22.04
324329 needs : build
325-
330+
326331 steps :
327332 - name : Get build artifacts
328333 uses : actions/download-artifact@v4
329334 with :
330335 name : build-artifacts
331- path : up-transport-zenoh-cpp
332-
336+ path : up-transport-zenoh-cpp
337+
333338 - name : Install Valgrind
334339 run : |
335340 sudo apt-get update
336341 sudo apt-get install -y valgrind
337-
342+
338343 - name : Run Valgrind Helgrind
339344 continue-on-error : true
340345 run : |
@@ -356,7 +361,7 @@ jobs:
356361 fi
357362 EXCLUDE_TESTS["$test_binary"]+="$test_suite.$test_name"
358363 done < valgrind_exclude_test_helgrind.txt
359-
364+
360365 for test_binary in bin/*Test; do
361366 test_binary_name=$(basename $test_binary)
362367 echo "Running Valgrind Helgrind on $test_binary_name"
@@ -366,9 +371,9 @@ jobs:
366371 else
367372 valgrind --tool=helgrind --log-file="valgrind_logs/$test_binary_name_helgrind.log" ./$test_binary || true
368373 fi
369-
374+
370375 cat "valgrind_logs/$test_binary_name_helgrind.log" >> valgrind_logs/valgrind_complete_helgrind_log.log
371-
376+
372377 if grep -q "ERROR SUMMARY: [^0]" "valgrind_logs/$test_binary_name_helgrind.log"; then
373378 echo "Valgrind Helgrind errors found in $test_binary_name:"
374379 grep -A1 "ERROR SUMMARY:" "valgrind_logs/$test_binary_name_helgrind.log" >> valgrind_logs/valgrind_helgrind_summary.log
@@ -377,17 +382,17 @@ jobs:
377382 echo "------------------------"
378383 fi
379384 done
380-
385+
381386 echo "Valgrind Helgrind Summary:"
382387 cat valgrind_logs/valgrind_helgrind_summary.log
383-
388+
384389 - name : Upload Valgrind Helgrind logs
385390 uses : actions/upload-artifact@v4
386391 if : success() || failure()
387392 with :
388393 name : valgrind-helgrind-log
389- path : up-transport-zenoh-cpp/build/Release/valgrind_logs/valgrind_complete_helgrind_log.log
390-
394+ path : up-transport-zenoh-cpp/build/Release/valgrind_logs/valgrind_complete_helgrind_log.log
395+
391396 dhat :
392397 name : Run Valgrind DHAT
393398 runs-on : ubuntu-22.04
0 commit comments