Skip to content

Commit edd13e9

Browse files
authored
Add valgrind run for cppcheck / self-check
1 parent 2b22120 commit edd13e9

1 file changed

Lines changed: 49 additions & 9 deletions

File tree

.github/workflows/valgrind.yml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ name: valgrind
55
on: [push, pull_request]
66

77
jobs:
8-
build:
98

9+
test-cppcheck:
10+
11+
name: Run valgrind on cppcheck
1012
runs-on: ubuntu-20.04
1113

1214
steps:
@@ -34,17 +36,55 @@ jobs:
3436
- name: Build cppcheck
3537
run: |
3638
CXXFLAGS="-O1 -g" make -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes
37-
38-
- name: Build test
39-
run: |
40-
CXXFLAGS="-O1 -g" make -j$(nproc) testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes
41-
42-
- name: Run valgrind
39+
40+
- name: Run valgrind on cppcheck self-check
4341
run: |
44-
valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate 9>memcheck.log
45-
cat memcheck.log
42+
valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./cppcheck --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings cli lib gui 9>memcheck_cppcheck.log
43+
cat memcheck_cppcheck.log
4644
4745
- uses: actions/upload-artifact@v2
4846
with:
4947
name: Logs
5048
path: ./*.log
49+
50+
51+
test-testrunner:
52+
53+
name: Run valgrind on testrunner
54+
runs-on: ubuntu-20.04
55+
56+
steps:
57+
- uses: actions/checkout@v2
58+
59+
- name: Prepare
60+
run: |
61+
sudo apt-get update
62+
sudo apt-get install debian-goodies ubuntu-dbgsym-keyring
63+
64+
- name: Add debug repos on ubuntu
65+
run: |
66+
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
67+
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
68+
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
69+
70+
- name: Install missing software
71+
run: |
72+
sudo apt-get update
73+
sudo apt-get install libxml2-utils
74+
sudo apt-get install valgrind
75+
sudo apt-get install libz3-dev libz3-4 libz3-4-dbgsym
76+
sudo apt-get install libc6-dbg-amd64-cross
77+
78+
- name: Build test
79+
run: |
80+
CXXFLAGS="-O1 -g" make -j$(nproc) testrunner USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes
81+
82+
- name: Run valgrind on testrunner
83+
run: |
84+
valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate 9>memcheck_testrunner.log
85+
cat memcheck_testrunner.log
86+
87+
- uses: actions/upload-artifact@v2
88+
with:
89+
name: Logs
90+
path: ./*.log

0 commit comments

Comments
 (0)