-
Notifications
You must be signed in to change notification settings - Fork 140
288 lines (258 loc) · 10.3 KB
/
test.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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
name: Test
on:
push:
pull_request:
workflow_dispatch:
jobs:
# Simple tests on Linux; except the ParFORM case, they probably pass unless
# the committer has forgotten running "make check".
check:
name: Test (${{ matrix.test }}) for ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- {bin: form, test: default}
- {bin: tform, test: default}
- {bin: tform, test: default, nthreads: 2}
- {bin: parform, test: default, timeout: 15}
- {bin: form, test: checkpoint}
- {bin: tform, test: checkpoint}
- {bin: form, test: forcer, timeout: 60}
- {bin: tform, test: forcer, timeout: 60}
- {bin: tform, test: forcer, nthreads: 2, timeout: 60}
- {bin: tform, test: multithreaded}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # ensures a reachable tag
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: libmpfr-dev libzstd-dev
version: 1.0
- name: Install MPI if necessary
if: matrix.bin == 'parform' || matrix.bin == 'parvorm'
run: |
sudo apt update
sudo apt install -y -q libmpich-dev
- name: Configure
run: |
opts='--disable-dependency-tracking'
case ${{ matrix.bin }} in
form|vorm) opts="$opts --enable-scalar --disable-threaded --disable-parform";;
tform|tvorm) opts="$opts --disable-scalar --enable-threaded --disable-parform";;
parform|parvorm) opts="$opts --disable-scalar --disable-threaded --enable-parform";;
esac
case ${{ matrix.bin }} in
vorm|tvorm|parvorm) opts="$opts --enable-debug";;
esac
opts="$opts --with-gmp --with-zlib --with-zstd"
autoreconf -i
./configure $opts
- name: Build
run: make -C sources -j 4 ${{ matrix.bin }}
- name: Cache library
id: cache-formlib
if: contains(fromJson('["forcer"]'), matrix.test)
uses: actions/cache@v4
with:
path: formlib
key: formlib-${{ matrix.test }}
- name: Install library if necessary
if: steps.cache-formlib.outputs.cache-hit != 'true'
run: |
mkdir -p formlib
case ${{ matrix.test }} in
forcer)
wget https://github.com/benruijl/forcer/archive/v1.0.0.tar.gz -O - | tar -x --gzip
mv forcer-1.0.0/forcer.h formlib
mv forcer-1.0.0/forcer formlib
rm -rf forcer-1.0.0
;;
esac
- name: Test
run: ./check/check.rb ./sources/${{ matrix.bin }} --stat ${{ matrix.nthreads && format('-w{0}', matrix.nthreads) || '' }} ${{ matrix.timeout && format('--timeout {0}', matrix.timeout) || '' }} ${{ matrix.test != 'default' && format('-C {0}', matrix.test) || '' }}
env:
FORMPATH: ${{ github.workspace }}/formlib
# Check memory errors (e.g., uninitialized values and memory leaks)
# thoroughly by using Valgrind on Linux. To maximize the use of concurrent
# jobs, we divide the tests into smaller parts.
valgrind-check:
name: Valgrind check for ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }} (${{ matrix.group }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- {bin: vorm, group: 1/5}
- {bin: vorm, group: 2/5}
- {bin: vorm, group: 3/5}
- {bin: vorm, group: 4/5}
- {bin: vorm, group: 5/5}
- {bin: tvorm, group: 1/10}
- {bin: tvorm, group: 2/10}
- {bin: tvorm, group: 3/10}
- {bin: tvorm, group: 4/10}
- {bin: tvorm, group: 5/10}
- {bin: tvorm, group: 6/10}
- {bin: tvorm, group: 7/10}
- {bin: tvorm, group: 8/10}
- {bin: tvorm, group: 9/10}
- {bin: tvorm, group: 10/10}
- {bin: tvorm, nthreads: 2, group: 1/10}
- {bin: tvorm, nthreads: 2, group: 2/10}
- {bin: tvorm, nthreads: 2, group: 3/10}
- {bin: tvorm, nthreads: 2, group: 4/10}
- {bin: tvorm, nthreads: 2, group: 5/10}
- {bin: tvorm, nthreads: 2, group: 6/10}
- {bin: tvorm, nthreads: 2, group: 7/10}
- {bin: tvorm, nthreads: 2, group: 8/10}
- {bin: tvorm, nthreads: 2, group: 9/10}
- {bin: tvorm, nthreads: 2, group: 10/10}
- {bin: parvorm, group: 1/10}
- {bin: parvorm, group: 2/10}
- {bin: parvorm, group: 3/10}
- {bin: parvorm, group: 4/10}
- {bin: parvorm, group: 5/10}
- {bin: parvorm, group: 6/10}
- {bin: parvorm, group: 7/10}
- {bin: parvorm, group: 8/10}
- {bin: parvorm, group: 9/10}
- {bin: parvorm, group: 10/10}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # ensures a reachable tag
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: libmpfr-dev libzstd-dev valgrind
version: 1.0
- name: Install MPI if necessary
if: matrix.bin == 'parform' || matrix.bin == 'parvorm'
run: |
sudo apt update
sudo apt install -y -q libmpich-dev
- name: Configure
run: |
opts='--disable-dependency-tracking'
case ${{ matrix.bin }} in
form|vorm) opts="$opts --enable-scalar --disable-threaded --disable-parform";;
tform|tvorm) opts="$opts --disable-scalar --enable-threaded --disable-parform";;
parform|parvorm) opts="$opts --disable-scalar --disable-threaded --enable-parform";;
esac
case ${{ matrix.bin }} in
vorm|tvorm|parvorm) opts="$opts --enable-debug";;
esac
opts="$opts --with-gmp --with-zlib --with-zstd"
autoreconf -i
./configure $opts
- name: Build
run: make -C sources -j 4 ${{ matrix.bin }}
- name: Test
run: ./check/check.rb valgrind ./sources/${{ matrix.bin }} --stat -g ${{ matrix.group }} --retries 5 ${{ matrix.nthreads && format('-w{0}', matrix.nthreads) || '' }}
# Generate LCOV coverage data to be posted to coveralls.io. Note that
# we measure code coverage only for tests checked with Valgrind.
coverage:
name: Code coverage for ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- {bin: vorm}
- {bin: tvorm}
- {bin: tvorm, nthreads: 2}
- {bin: parvorm}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # ensures a reachable tag
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: lcov libmpfr-dev libzstd-dev
version: 1.0
- name: Install MPI if necessary
if: matrix.bin == 'parform' || matrix.bin == 'parvorm'
run: |
sudo apt update
sudo apt install -y -q libmpich-dev
- name: Configure
run: |
opts='--disable-dependency-tracking'
case ${{ matrix.bin }} in
vorm) opts="$opts --enable-scalar --disable-threaded --disable-parform";;
tvorm) opts="$opts --disable-scalar --enable-threaded --disable-parform";;
parvorm) opts="$opts --disable-scalar --disable-threaded --enable-parform";;
esac
opts="$opts --enable-debug --enable-coverage --with-gmp --with-zlib --with-zstd"
autoreconf -i
./configure $opts
- name: Build
run: make -C sources -j 4 ${{ matrix.bin }}
- name: Test
run: ./check/check.rb ./sources/${{ matrix.bin }} --stat --timeout 30 ${{ matrix.nthreads && format('-w{0}', matrix.nthreads) || '' }}
- name: Generate LCOV coverage data
run: |
lcov -d . -c -o coverage.lcov
lcov -r coverage.lcov */usr/include/* -o coverage.lcov
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
flag-name: ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }}
parallel: true
# Post LCOV coverage data to coveralls.io.
coverage-finish:
needs: [check, valgrind-check, coverage]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
# Tests with a 32-bit container.
check-i386:
name: 32-bit container check for ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }}
runs-on: ubuntu-latest
container:
image: i386/debian:11.5
strategy:
fail-fast: false
matrix:
include:
- {bin: form}
- {bin: tform}
- {bin: tform, nthreads: 2}
steps:
# We have to use v1.
# See https://github.com/actions/checkout/issues/334
- name: Checkout repository
uses: actions/checkout@v1
- name: Install dependencies
run: |
apt-get update
apt-get -y install automake build-essential git libgmp-dev libmpfr-dev libzstd-dev ruby zlib1g-dev
# Fix dubious ownership for Git operations.
# See https://github.com/actions/runner/issues/2033#issuecomment-1204205989
- name: Set ownership
run: chown -R $(id -u):$(id -g) $PWD
- name: Configure
run: |
opts='--disable-dependency-tracking'
case ${{ matrix.bin }} in
form) opts="$opts --enable-scalar --disable-threaded --disable-parform";;
tform) opts="$opts --disable-scalar --enable-threaded --disable-parform";;
esac
opts="$opts --disable-debug --with-gmp --with-zlib --with-zstd"
autoreconf -i
./configure $opts
- name: Build
run: make -C sources -j 4 ${{ matrix.bin }}
- name: Test
run: ./check/check.rb ./sources/${{ matrix.bin }} --stat --wordsize 2 ${{ matrix.nthreads && format('-w{0}', matrix.nthreads) || '' }}