-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.61 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
tests:
strategy:
matrix:
for: ["regular", "amalgamated"]
name: Tests (${{ matrix.for }})
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install clang & valgrind
run: |
sudo apt-get update
sudo apt-get install -y clang valgrind
- name: Amalgamate
if: ${{ matrix.for }} == "amalgamated"
run: |
make amalgamate
rm -r src/* tests/* # Get rid of current code
cp -r amalgamate/test/* . # Move the amalgamated version in its place (so later stuff works)
- name: Build
run: |
make tests debug
- name: Run tests (debug)
run: |
bin/tests-debug
- name: Run tests (optimized)
run: |
bin/tests
- name: Run tests (valgrind)
run: |
valgrind --leak-check=full -s --show-leak-kinds=all bin/tests-debug 2> valgrind_output.txt 1>&2 || true
cat valgrind_output.txt
if ! tail -7 valgrind_output.txt | grep -q "All heap blocks were freed -- no leaks are possible" valgrind_output.txt; then
exit 1; # exit if not found, we need this check because valgrind exit codes are bad
fi
if ! tail -7 valgrind_output.txt | grep -q "ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)" valgrind_output.txt; then
exit 1; # exit if not found, we need this check because valgrind exit codes are bad
fi