Skip to content

Commit bf161b4

Browse files
committed
Add valgrind checks to all of the samples
1 parent 375650e commit bf161b4

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/samples.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
fi
7575
7676
mkdir build && cd build
77-
cmake .. -DBUILD_DEPENDENCIES=OFF
77+
cmake .. -DBUILD_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo
7878
make -j$num_procs
7979
8080
- name: Change token rotation to 30s
@@ -266,3 +266,27 @@ jobs:
266266
267267
exit $failed
268268
shell: bash
269+
- name: Run Valgrind on ${{ matrix.sample-executable.name }} (Linux)
270+
if: runner.os == 'Linux'
271+
working-directory: ./build
272+
run: |
273+
set -o pipefail
274+
set +e
275+
276+
echo "Running Valgrind on ${{ matrix.sample-executable.name }}"
277+
mkdir -p valgrind_logs
278+
valgrind \
279+
--leak-check=full \
280+
--show-leak-kinds=all \
281+
--track-origins=yes \
282+
--error-exitcode=1 \
283+
--log-file=valgrind_logs/valgrind_${{ matrix.sample-executable.name }}.log \
284+
./${{ matrix.sample-executable.name }} "$KVS_STREAM_NAME" ${{ matrix.sample-executable.args }}
285+
valgrind_exit_code=$?
286+
287+
echo "========== Valgrind Output =========="
288+
cat valgrind_logs/${{ matrix.sample-executable.name }}.log
289+
echo "====================================="
290+
291+
exit "$valgrind_exit_code"
292+
shell: bash

0 commit comments

Comments
 (0)