Skip to content

Commit 39215fc

Browse files
committed
add valgrind flow
1 parent 14eb056 commit 39215fc

File tree

2 files changed

+313
-63
lines changed

2 files changed

+313
-63
lines changed
Lines changed: 313 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
name: valgrind
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
unit_tests:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Install Valgrind
13+
run: sudo apt-get update && sudo apt-get install valgrind
14+
15+
- name: Checkout METIS
16+
uses: actions/checkout@v4
17+
with:
18+
repository: galabovaa/METIS
19+
ref: 510-ts
20+
path: METIS
21+
22+
- name: Create installs dir
23+
working-directory: ${{runner.workspace}}
24+
run: |
25+
mkdir installs
26+
ls
27+
28+
- name: Install METIS
29+
run: |
30+
cmake \
31+
-S $GITHUB_WORKSPACE/METIS \
32+
-B build \
33+
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
34+
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
35+
cmake --build build --parallel
36+
cmake --install build
37+
38+
# no default blas available on runner
39+
40+
- name: Cache APT packages
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
/var/cache/apt/archives
45+
/var/lib/apt/lists
46+
key: ${{ runner.os }}-apt-libopenblas
47+
48+
- name: Install OpenBLAS
49+
shell: bash
50+
run: |
51+
sudo apt update
52+
sudo apt install libopenblas-dev
53+
- name: Create Build Environment
54+
run: cmake -E make_directory ${{runner.workspace}}/build
55+
56+
- name: Configure CMake
57+
shell: bash
58+
working-directory: ${{runner.workspace}}/build
59+
run:
60+
cmake $GITHUB_WORKSPACE -DHIPO=ON \
61+
-DCMAKE_BUILD_TYPE=Debug \
62+
-DALL_TESTS=ON \
63+
-DBLA_VENDOR=OpenBLAS \
64+
-DMETIS_ROOT=${{runner.workspace}}/installs
65+
66+
- name: Build
67+
working-directory: ${{runner.workspace}}/build
68+
shell: bash
69+
run: |
70+
cmake --build . -j2
71+
72+
- name: Test
73+
working-directory: ${{runner.workspace}}/build
74+
shell: bash
75+
run: |
76+
valgrind \
77+
--leak-check=full \
78+
--show-leak-kinds=all \
79+
--track-origins=yes \
80+
-s \
81+
./bin/unit_tests \
82+
2>&1 | tee logfile
83+
84+
- name: Check log for Errors
85+
working-directory: ${{runner.workspace}}/build
86+
shell: bash
87+
run: |
88+
cat logfile
89+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
90+
if grep -q "$OUTPUT" logfile; then
91+
exit 0
92+
fi
93+
exit 1
94+
95+
instance_tests:
96+
runs-on: ${{ matrix.os }}
97+
strategy:
98+
matrix:
99+
os: [ubuntu-latest]
100+
101+
steps:
102+
- uses: actions/checkout@v4
103+
104+
- name: Install Valgrind
105+
run: sudo apt-get update && sudo apt-get install valgrind
106+
107+
- name: Checkout METIS
108+
uses: actions/checkout@v4
109+
with:
110+
repository: galabovaa/METIS
111+
ref: 510-ts
112+
path: METIS
113+
114+
- name: Create installs dir
115+
working-directory: ${{runner.workspace}}
116+
run: |
117+
mkdir installs
118+
ls
119+
120+
- name: Install METIS
121+
run: |
122+
cmake \
123+
-S $GITHUB_WORKSPACE/METIS \
124+
-B build \
125+
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
126+
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
127+
cmake --build build --parallel
128+
cmake --install build
129+
130+
# no default blas available on runner
131+
132+
- name: Cache APT packages
133+
uses: actions/cache@v4
134+
with:
135+
path: |
136+
/var/cache/apt/archives
137+
/var/lib/apt/lists
138+
key: ${{ runner.os }}-apt-libopenblas
139+
140+
- name: Install OpenBLAS
141+
shell: bash
142+
run: |
143+
sudo apt update
144+
sudo apt install libopenblas-dev
145+
- name: Create Build Environment
146+
run: cmake -E make_directory ${{runner.workspace}}/build
147+
148+
- name: Create Build Environment
149+
run: cmake -E make_directory ${{runner.workspace}}/build
150+
151+
- name: Configure CMake
152+
shell: bash
153+
working-directory: ${{runner.workspace}}/build
154+
run:
155+
cmake $GITHUB_WORKSPACE -DHIPO=ON \
156+
-DCMAKE_BUILD_TYPE=Debug \
157+
-DALL_TESTS=ON \
158+
-DBLA_VENDOR=OpenBLAS \
159+
-DMETIS_ROOT=${{runner.workspace}}/installs
160+
161+
- name: Build
162+
working-directory: ${{runner.workspace}}/build
163+
shell: bash
164+
run: |
165+
cmake --build . -j2
166+
167+
- name: Test
168+
working-directory: ${{runner.workspace}}/build
169+
shell: bash
170+
run: |
171+
valgrind \
172+
--leak-check=full \
173+
--show-leak-kinds=all \
174+
--track-origins=yes \
175+
-s \
176+
ctest -E unit.* \
177+
--timeout 1000 \
178+
--output-on-failure \
179+
2>&1 | tee logfile2
180+
181+
- name: Check log for Errors
182+
working-directory: ${{runner.workspace}}/build
183+
shell: bash
184+
run: |
185+
cat logfile2
186+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
187+
if grep -q "$OUTPUT" logfile2; then
188+
exit 0
189+
fi
190+
exit 1
191+
192+
examples:
193+
runs-on: ${{ matrix.os }}
194+
strategy:
195+
matrix:
196+
os: [ubuntu-latest]
197+
198+
steps:
199+
- uses: actions/checkout@v4
200+
201+
- name: Install Valgrind
202+
run: sudo apt-get update && sudo apt-get install valgrind
203+
204+
- name: Checkout METIS
205+
uses: actions/checkout@v4
206+
with:
207+
repository: galabovaa/METIS
208+
ref: 510-ts
209+
path: METIS
210+
211+
- name: Create installs dir
212+
working-directory: ${{runner.workspace}}
213+
run: |
214+
mkdir installs
215+
ls
216+
217+
- name: Install METIS
218+
run: |
219+
cmake \
220+
-S $GITHUB_WORKSPACE/METIS \
221+
-B build \
222+
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
223+
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
224+
cmake --build build --parallel
225+
cmake --install build
226+
227+
# no default blas available on runner
228+
229+
- name: Cache APT packages
230+
uses: actions/cache@v4
231+
with:
232+
path: |
233+
/var/cache/apt/archives
234+
/var/lib/apt/lists
235+
key: ${{ runner.os }}-apt-libopenblas
236+
237+
- name: Install OpenBLAS
238+
shell: bash
239+
run: |
240+
sudo apt update
241+
sudo apt install libopenblas-dev
242+
- name: Create Build Environment
243+
run: cmake -E make_directory ${{runner.workspace}}/build
244+
245+
- name: Create Build Environment
246+
run: cmake -E make_directory ${{runner.workspace}}/build
247+
248+
- name: Configure CMake
249+
shell: bash
250+
working-directory: ${{runner.workspace}}/build
251+
run:
252+
cmake $GITHUB_WORKSPACE -DHIPO=ON \
253+
-DCMAKE_BUILD_TYPE=Debug \
254+
-DALL_TESTS=ON \
255+
-DBLA_VENDOR=OpenBLAS \
256+
-DMETIS_ROOT=${{runner.workspace}}/installs
257+
258+
259+
- name: Build
260+
working-directory: ${{runner.workspace}}/build
261+
shell: bash
262+
run: |
263+
cmake --build . -j2
264+
265+
- name: Test cpp example
266+
working-directory: ${{runner.workspace}}/build
267+
shell: bash
268+
run: |
269+
valgrind \
270+
--leak-check=full \
271+
--show-leak-kinds=all \
272+
--track-origins=yes \
273+
-s \
274+
./bin/call_highs_from_cpp \
275+
--timeout 1000 \
276+
--output-on-failure \
277+
2>&1 | tee logfile2
278+
279+
- name: Check log for Errors
280+
working-directory: ${{runner.workspace}}/build
281+
shell: bash
282+
run: |
283+
cat logfile2
284+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
285+
if grep -q "$OUTPUT" logfile2; then
286+
exit 0
287+
fi
288+
exit 1
289+
290+
- name: Test C example
291+
working-directory: ${{runner.workspace}}/build
292+
shell: bash
293+
run: |
294+
valgrind \
295+
--leak-check=full \
296+
--show-leak-kinds=all \
297+
--track-origins=yes \
298+
-s \
299+
./bin/call_highs_from_c_minimal \
300+
--timeout 1000 \
301+
--output-on-failure \
302+
2>&1 | tee logfile2
303+
304+
- name: Check log for Errors
305+
working-directory: ${{runner.workspace}}/build
306+
shell: bash
307+
run: |
308+
cat logfile2
309+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
310+
if grep -q "$OUTPUT" logfile2; then
311+
exit 0
312+
fi
313+
exit 1

highs/pdlp/README.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)