-
Notifications
You must be signed in to change notification settings - Fork 732
132 lines (123 loc) · 3.6 KB
/
make.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Continuous Integration
on: [push, pull_request, workflow_dispatch]
jobs:
check_style_etc:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt -q install clang-format
- uses: actions/checkout@v4
- name: Check formatting
if: '!cancelled()'
run: |
clang-format -i */*.[ch]
git diff > formatting-fixes.diff
if ! grep "" formatting-fixes.diff; then
rm -f formatting-fixes.diff
else
(echo "Formatting errors detected by clang-format. Please run" \
"\`make format\` or apply formatting-fixes.diff below.";
echo) >> $GITHUB_STEP_SUMMARY
false
fi
- uses: actions/upload-artifact@v4
if: '!cancelled()'
with:
if-no-files-found: ignore
name: formatting-fixes.diff
path: formatting-fixes.diff
- name: Check C89 compliance
if: '!cancelled()'
env:
CFLAGS: "-O0 -Werror -std=c89 -pedantic -Isrc"
run: |
if ! gcc $CFLAGS -c */*.c; then
(echo "Code does not conform to ANSI C. Make sure not to use" \
"features from later standards, including C++-style " \
"// comments.";
echo) >> $GITHUB_STEP_SUMMARY
false
fi
- name: Check value types can be redefined
if: '!cancelled()'
env:
CFLAGS: "-O0 -Werror -DTEST_ALTERNATE_VALUE_TYPES"
run: |
if ! gcc $CFLAGS -c src/*.c; then
(echo "Compile failed when key/value types were redefined to" \
"something different from a void pointer. Compile with" \
"-DTEST_ALTERNATE_VALUE_TYPES to see the error.";
echo) >> $GITHUB_STEP_SUMMARY
false
fi
build_and_coverage:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt -q install doxygen
- uses: actions/checkout@v4
- name: configure
run: |
LDFLAGS="$CFLAGS" ./autogen.sh \
--enable-coverage
- name: make
run: make -j
- name: make check
run: |
make -j check || (cat test/test-suite.log; false)
- name: Generate coverage reports
run: |
mkdir artifacts
tar cf - src/*.gcov | tar -C artifacts -xf -
- name: Upload coverage-annotated source files
uses: actions/upload-artifact@v4
with:
path: "artifacts"
name: coverage_reports
- name: make dist
run: |
make distcheck
make dist
- name: Make documentation zip
uses: actions/upload-artifact@v4
with:
path: "doc/html"
name: documentation
valgrind_build:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt -q install valgrind
- uses: actions/checkout@v4
- name: configure
run: |
LDFLAGS="$CFLAGS" ./autogen.sh \
--enable-valgrind
- name: make
run: make -j
- name: make check
run: |
make -j check || (cat test/test-suite.log; false)
ubsan_build:
runs-on: ubuntu-latest
env:
CC: clang
# TODO: Add -fsanitize=address and memory too.
CFLAGS: "-fsanitize=undefined
-fno-omit-frame-pointer
-fno-sanitize-recover=all
-fno-sanitize=shift-base"
steps:
- uses: actions/checkout@v4
- name: configure
run: |
LDFLAGS="$CFLAGS" ./autogen.sh
- name: make check
run: |
make -j check || (cat test/test-suite.log; false)