-
Notifications
You must be signed in to change notification settings - Fork 5
219 lines (205 loc) · 8.71 KB
/
ci.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
name: ci
on:
push:
branches:
- master
- dev-1.x
- develop
pull_request:
branches:
- master
jobs:
linux:
runs-on: ${{ matrix.DISTRO }}
strategy:
fail-fast: false
matrix:
DISTRO:
- "ubuntu-20.04"
- "ubuntu-22.04"
- "ubuntu-latest"
CC:
- "gcc"
- "clang"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install packages
run: sudo apt-get install -y autotools-dev autoconf automake bats libtool m4 make pkg-config check libpcre3-dev libtalloc-dev libsubunit-dev lcov libjson-c-dev liblmdb-dev libyaml-dev ${{ matrix.CC }}
- run: autoreconf -i
- run: ./configure
env:
CC: ${{ matrix.CC }}
# json-c undeprecated json_object_object_get, but the version in xenial
# is too old, so let's silence deprecated warnings. le sigh.
CFLAGS: "-Wno-deprecated-declarations -Wno-error=deprecated-declarations"
- run: make
- run: make check
- run: make distcheck
- name: dump logs
if: ${{ failure() }}
run: |
for i in `find tests -name "*.log" 2>/dev/null`; do
echo "-- START ${i}";
cat "${i}";
echo "-- END";
done
linux_coverage:
runs-on: ${{ matrix.DISTRO }}
strategy:
fail-fast: false
matrix:
DISTRO:
- "ubuntu-20.04"
- "ubuntu-22.04"
- "ubuntu-latest"
CC:
- "gcc"
# - "clang"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install packages
run: sudo apt-get install -y autotools-dev autoconf automake bats libtool m4 make pkg-config check libpcre3-dev libtalloc-dev libsubunit-dev lcov libjson-c-dev liblmdb-dev libyaml-dev lcov ${{ matrix.CC }}
- run: autoreconf -i
- run: ./configure --enable-code-coverage
env:
CC: ${{ matrix.CC }}
# json-c undeprecated json_object_object_get, but the version in xenial
# is too old, so let's silence deprecated warnings. le sigh.
CFLAGS: "-Wno-deprecated-declarations -Wno-error=deprecated-declarations"
- run: make
- run: make check
- run: make code-coverage-capture
- name: Coveralls
# if: ${{ matrix.COVERAGE == 'true' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./handlebars-coverage.info
- name: dump logs
if: ${{ failure() }}
run: |
for i in `find tests -name "*.log" 2>/dev/null`; do
echo "-- START ${i}";
cat "${i}";
echo "-- END";
done
linux_scanbuild:
runs-on: ${{ matrix.DISTRO }}
strategy:
fail-fast: false
matrix:
DISTRO:
- "ubuntu-20.04"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install packages
run: sudo apt-get install -y autotools-dev autoconf automake bats libtool m4 make pkg-config check libpcre3-dev libtalloc-dev libsubunit-dev lcov libjson-c-dev liblmdb-dev libyaml-dev clang-tools html2text
- run: autoreconf -i
- run: scan-build ./configure
env:
# json-c undeprecated json_object_object_get, but the version in xenial
# is too old, so let's silence deprecated warnings. le sigh.
CFLAGS: "-Wno-deprecated-declarations -Wno-error=deprecated-declarations"
- run: scan-build -o scan-build make
- name: check for issues
run: |
if [ -n "$(find scan-build -name '*.html')" ]; then
echo "scan-build found potential issues"
find scan-build -name 'index.html' -print -exec html2text \{} \;
exit 1
fi
- uses: actions/upload-artifact@v4
if: failure()
with:
name: scan-build
path: scan-build
build_osx_autotools_default_args:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install packages
run: brew install autoconf automake bats-core json-c libtool libyaml lmdb pkg-config talloc check lcov pcre
- name: create configure
run: autoreconf -i
- name: configure
# disabling compiler warnings as error because of some weird issue with libtool and '-Wl,-fatal_warnings'
run: ./configure --disable-bison --disable-flex --disable-gperf --enable-compile-warnings=yes
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-bison --disable-flex --disable-gperf --enable-compile-warnings=yes"
- name: dump logs
if: ${{ failure() }}
run: |
for i in `find tests -name "*.log" 2>/dev/null`; do
echo "-- START ${i}";
cat "${i}";
echo "-- END";
done
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-24.05
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix:
name: "nix (${{ matrix.name }})"
runs-on: ${{ matrix.os }}
needs: nix-matrix
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Set Up Build Cache
uses: actions/cache@v4
id: nix-cache
with:
path: /tmp/nix-store.nar
key: nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }}
restore-keys: |
nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }}
nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-
nix-store.nar-${{ runner.os }}-
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-24.05
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
- name: Import Nix Store Cache
if: "steps.nix-cache.outputs.cache-hit == 'true'"
run: |
nix-store --import < /tmp/nix-store.nar
- run: sudo sysctl -w kernel.perf_event_paranoid=1
- run: nix build -L ".#${{ matrix.attr }}"
# - run: nix flake check -L
# broken sigh
# - name: Export Nix Store Cache
# shell: bash
# # partially based on https://github.com/NixOS/nix/issues/1245#issuecomment-282586759
# run: |
# drv="$(nix-store -qd "$(readlink result)")"
# drvRefs="$( echo "$drv" | xargs nix-store -q --references )"
# ( echo "$drvRefs" | grep '[.]drv$' | xargs nix-store -q --outputs ;
# echo "$drvRefs" | grep -v '[.]drv$' ) | \
# xargs nix-store -r | \
# xargs nix-store -qR |
# xargs nix-store --export > /tmp/nix-store.nar