Skip to content

Commit 04678fc

Browse files
lammjogregmedd
andauthored
Feature/zenoh/108 update to 1.2.1 (eclipse-uprotocol#114)
* chore: update dependency to zenoh-cpp 1.2.1 * refactor: check for attachments instead of ref wrapping * ci: pin ubuntu and conan version, fix conan profile * doc: bump version in readme * fix: add base64 encoding * ci: reactivate tests and checks * feat: do not process incomplete uMessages * feat: serialize attachments to uint8_t arrays --------- Co-authored-by: Greg Medding <gregory.medding@gm.com>
1 parent 85a57d7 commit 04678fc

10 files changed

Lines changed: 173 additions & 139 deletions

File tree

.github/workflows/ci.yml

Lines changed: 108 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ['main']
66
pull_request:
7-
branches: ["**"]
7+
branches: ['**']
88

99
jobs:
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
@@ -49,8 +49,8 @@ jobs:
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

.github/workflows/ci_conan_profile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ compiler=gcc
55
compiler.cppstd=gnu17
66
compiler.libcxx=libstdc++11
77
compiler.version=11
8-
os=Linux
8+
os=Linux

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ target_link_libraries(${PROJECT_NAME}
6565
up-cpp::up-cpp
6666
up-core-api::up-core-api
6767
protobuf::libprotobuf
68-
spdlog::spdlog)
68+
spdlog::spdlog
69+
)
6970

7071
enable_testing()
7172
add_subdirectory(test)

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ from [up-cpp][cpp-api-repo].
2020
Using the recipes found in [up-conan-recipes][conan-recipe-repo], build these
2121
Conan packages:
2222

23-
1. [up-core-api][spec-repo] - `conan create --version 1.6.0 --build=missing up-core-api/release`
24-
1. [up-cpp][cpp-api-repo] - `conan create --version 1.0.1-rc1 --build=missing up-cpp/release`
25-
2. [zenoh-c][zenoh-repo] - `conan create --version 0.11.0 zenoh-tmp/from-source`
23+
1. [up-core-api][spec-repo] - `conan create --version 1.6.0-alpha4 --build=missing up-core-api/release`
24+
2. [up-cpp][cpp-api-repo] - `conan create --version 1.0.1 --build=missing up-cpp/release`
25+
3. [zenoh-c][zenoh-repo] - `conan create --version 1.2.1 zenohc-tmp/prebuilt`
26+
4. [zenoh-c][zenoh-repo] - `conan create --version 1.2.1 zenohcpp-tmp/from-source`
2627

2728
**NOTE:** all `conan` commands in this document use Conan 2.x syntax. Please
2829
adjust accordingly when using Conan 1.x.

0 commit comments

Comments
 (0)