Skip to content

Commit 76e8fc1

Browse files
committed
CI failing if ERROR > 0
1 parent 81d7052 commit 76e8fc1

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

.github/workflows/valgrind.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,25 @@ jobs:
3232
- name: Test
3333
working-directory: ${{runner.workspace}}/build
3434
shell: bash
35-
run: valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes -s ./bin/unit_tests
35+
run: |
36+
valgrind \
37+
--leak-check=full \
38+
--show-leak-kinds=all \
39+
--track-origins=yes \
40+
-s \
41+
./bin/unit_tests multi-objective \
42+
2>&1 | tee logfile
43+
44+
- name: Check log for Errors
45+
working-directory: ${{runner.workspace}}/build
46+
shell: bash
47+
run: |
48+
cat logfile
49+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
50+
if grep -q "$OUTPUT" logfile; then
51+
exit 0
52+
fi
53+
exit 1
3654
3755
instance_tests:
3856
runs-on: ${{ matrix.os }}
@@ -63,4 +81,24 @@ jobs:
6381
- name: Test
6482
working-directory: ${{runner.workspace}}/build
6583
shell: bash
66-
run: valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes -s ctest -E unit.* --timeout 1000 --output-on-failure
84+
run: |
85+
valgrind \
86+
--leak-check=full \
87+
--show-leak-kinds=all \
88+
--track-origins=yes \
89+
-s \
90+
ctest -E unit.* \
91+
--timeout 1000 \
92+
--output-on-failure \
93+
2>&1 | tee logfile2
94+
95+
- name: Check log for Errors
96+
working-directory: ${{runner.workspace}}/build
97+
shell: bash
98+
run: |
99+
cat logfile2
100+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
101+
if grep -q "$OUTPUT" logfile2; then
102+
exit 0
103+
fi
104+
exit 1

0 commit comments

Comments
 (0)