File tree Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Original file line number Diff line number Diff line change 63
63
if : runner.os == 'Linux'
64
64
run : |
65
65
apt-get update
66
- apt-get install -y git cmake build-essential pkg-config libssl-dev libcurl4-openssl-dev mkvtoolnix curl unzip
66
+ apt-get install -y git cmake build-essential pkg-config libssl-dev libcurl4-openssl-dev mkvtoolnix curl unzip valgrind
67
67
68
68
- name : Build repository
69
69
run : |
74
74
fi
75
75
76
76
mkdir build && cd build
77
- cmake .. -DBUILD_DEPENDENCIES=OFF
77
+ cmake .. -DBUILD_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo
78
78
make -j$num_procs
79
79
80
80
- name : Change token rotation to 30s
@@ -266,3 +266,34 @@ jobs:
266
266
267
267
exit $failed
268
268
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
+ mkdir -p valgrind_logs
277
+
278
+ LOG_FILE="valgrind_logs/${{ matrix.sample-executable.name }}.log"
279
+
280
+ echo "::group::Application logs for ${{ matrix.sample-executable.name }}"
281
+ valgrind \
282
+ --leak-check=full \
283
+ --show-leak-kinds=all \
284
+ --track-origins=yes \
285
+ --error-exitcode=1 \
286
+ --log-file="$LOG_FILE" \
287
+ ./${{ matrix.sample-executable.name }} "$KVS_STREAM_NAME" ${{ matrix.sample-executable.args }}
288
+ echo "::endgroup::"
289
+
290
+ echo "========== Valgrind Output =========="
291
+ cat "$LOG_FILE"
292
+ echo "====================================="
293
+
294
+ if grep -qE "definitely lost: [^0]" "$LOG_FILE" || grep -qE "indirectly lost: [^0]" "$LOG_FILE"; then
295
+ echo "❌ Valgrind found something definitely or indirectly lost"
296
+ exit 1
297
+ fi
298
+
299
+ shell : bash
You can’t perform that action at this time.
0 commit comments