-
Notifications
You must be signed in to change notification settings - Fork 161
306 lines (278 loc) · 12.3 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
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
name: CI
# Trigger the workflow on push or pull request
on:
workflow_dispatch:
inputs:
# see https://github.com/marketplace/actions/debugging-with-tmate
debug_enabled:
description: 'Run the build with tmate debugging enabled'
type: boolean
pull_request:
push:
schedule:
# Every day at 2:30 AM UTC
- cron: '30 2 * * *'
concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the master branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
env:
# default config flags: enable debug asserts
CONFIGFLAGS: "--enable-debug"
# CHERE_INVOKING=1 lets us start a 'login shell' (to set paths) in Windows without changing directory
CHERE_INVOKING: 1
jobs:
test:
name: ${{ matrix.test-suites }} - ${{ matrix.extra }} - ${{ matrix.os }}
# Don't run this twice on PRs for branches pushed to the same repository
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
shell: [bash]
test-suites:
[
# base test: fast first test
"testinstall",
"teststandard",
# run tests contained in the manual
"testmanuals",
# test error reporting and compiling as well as libgap
"testexpect testmockpkg testspecial test-compile testlibgap testkernel",
# compile packages and run GAP tests
# don't use --enable-debug to prevent the tests from taking too long
"testpackages testinstall-loadall",
]
extra: [""]
# add a few extra tests
include:
# test creating the manual
# also test `make install` here, as that wants the manual, too;
# and set NO_COVERAGE=1 to ensure the installed GAP binaries don't
# contain references to the build directory
- os: ubuntu-latest
shell: bash
test-suites: "makemanuals testmakeinstall"
extra: "GAPPREFIX=/tmp/gapprefix CONFIGFLAGS=\"--prefix=/tmp/gapprefix\" NO_COVERAGE=1"
- os: ubuntu-20.04
shell: bash
test-suites: "teststandard"
extra: "ABI=32 CONFIGFLAGS=\"\""
# FIXME: we used to run `teststandard` for HPC-GAP under Travis CI,
# but somehow when running on GitHub Actions, it takes almost 4
# hours (!) to complete instead of 25 minutes. So for now we just
# run testinstall.
- os: ubuntu-latest
shell: bash
test-suites: "testinstall"
extra: "HPCGAP=yes ABI=64"
# this job also tests GAP without readline
- os: macos-latest
shell: bash
test-suites: "testmockpkg testinstall"
extra: "BOOTSTRAP_MINIMAL=yes"
# run bugfix regression tests
# Also turn on '--enable-memory-checking' to make sure GAP compiles
# with the flag enabled. We do not actually test the memory
# checking, as this slows down GAP too much.
# Also check ubuntu-latest works.
- os: ubuntu-latest
shell: bash
test-suites: "testbugfix"
extra: "CONFIGFLAGS=\"--enable-memory-checking\""
# out of tree builds -- these are mainly done to verify that the
# build system work in this scenario. Since we don't expect the test
# results to vary compared to the in-tree builds, we turn off
# coverage reporting by setting NO_COVERAGE=1; this has the extra
# benefit of also running the tests at least once with the
# ReproducibleBehaviour option turned off.
# The '--enable-valgrind' checks that GAP builds and runs correctly
# when compiled with valgrind support. We do not actually run any
# tests using valgrind, as it is too slow.
- os: ubuntu-latest
shell: bash
test-suites: "testbuildsys testmockpkg testinstall"
extra: "NO_COVERAGE=1 ABI=64 BUILDDIR=out-of-tree
CONFIGFLAGS=\"--enable-valgrind\""
packages: "valgrind"
# same as above, but in 32 bit mode, also turn off debugging (see
# elsewhere in this file for an explanation).
- os: ubuntu-20.04
shell: bash
test-suites: "testbuildsys testmockpkg testinstall"
extra: "NO_COVERAGE=1 ABI=32 BUILDDIR=out-of-tree CONFIGFLAGS=\"\""
# test Julia integration
- os: ubuntu-20.04
shell: bash
test-suites: "testinstall"
extra: "JULIA=yes CONFIGFLAGS=\"--enable-debug --disable-Werror\""
- os: windows-2019
# The 'run' steps in this job use Cygwin's bash, once it is set up.
# --login: make a login shell (so PATH is set up)
# -o igncr: Accept windows line endings
# {0} : Pass any extra arguments from CI
shell: C:\cygwin64\bin\bash.exe --login -o igncr '{0}'
test-suites: "testmockpkg testinstall"
env:
TEST_SUITES: ${{ matrix.test-suites }}
steps:
- uses: actions/checkout@v3
- name: "Set up Python"
uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: gap-actions/setup-cygwin@v1
if: ${{ runner.os == 'Windows' }}
with:
PKGS_TO_INSTALL: 'wget,git,gcc-g++,gcc-core,m4,libgmp-devel,make,automake,libtool,autoconf,autoconf2.5,zlib-devel,libreadline-devel,libmpc-devel,libmpfr-devel,xdg-utils,pkg-config'
# There are two cygwin installs on github actions (ours,
# and a preinstalled one which we can't use as not enough packages are installed.
# Due to conflicts between these two, we cannot spawn new Cygwin processes and
# then use IO between processes
- if: ${{ runner.os == 'Windows' }}
name: "Remove tests which do not work on github actions in Windows"
run: |
rm tst/testinstall/testunix/streamio.tst tst/testinstall/testunix/streams.tst
- name: "Set up compiler and linker flags"
run: |
${{ matrix.extra }}
if [[ -n ${NO_COVERAGE} ]] ; then
echo "No coverage reporting"
else
echo "Coverage reporting, updating compiler and linker flags"
echo "CFLAGS=--coverage -O2 -g" >> $GITHUB_ENV
echo "CXXFLAGS=--coverage -O2 -g" >> $GITHUB_ENV
echo "LDFLAGS=--coverage" >> $GITHUB_ENV
fi
- name: "Install dependencies"
run: |
${{ matrix.extra }}
echo "${{ matrix.extra }}" > extra.flags
if [ "$RUNNER_OS" == "Linux" ]; then
packages=(${{ matrix.packages }})
if [[ $TEST_SUITES == *testbuildsys* ]] ; then
sudo apt-get remove libgmp-dev libreadline-dev zlib1g-dev
else
packages+=(libgmp-dev libreadline-dev zlib1g-dev expect)
fi
if [[ $TEST_SUITES == *testpackages* ]] ; then
packages+=( # For:
4ti2 # 4ti2Interface
libcdd-dev # CddInterface
libcurl4-openssl-dev # curlInterface
libfplll-dev # float
libmpc-dev # float
libmpfi-dev # float
libmpfr-dev # float
libncurses-dev # browse
libzmq3-dev # ZeroMQInterface
pari-gp # alnuth
singular # singular
)
fi
if [[ $TEST_SUITES == *makemanuals* ]] ; then
packages+=(
texlive-latex-base
texlive-latex-recommended
texlive-latex-extra
texlive-fonts-recommended
)
fi
if [[ $ABI == 32 ]] ; then
sudo dpkg --add-architecture i386
for i in "${!packages[@]}"; do
packages[$i]="${packages[$i]}:i386"
done
packages+=(gcc-multilib g++-multilib)
fi
sudo apt-get update
sudo apt-get install --no-install-recommends "${packages[@]}"
sudo apt-get install pkg-config
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install gmp zlib pkg-config
fi
python -m pip install gcovr
# Setup ccache, to speed up repeated compilation of the same binaries
# (i.e., GAP and the packages)
- name: "Setup ccache"
if: ${{ runner.os != 'Windows' }}
uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
override_cache_key: ${{ runner.os }}-${{ hashFiles('extra.flags') }}-${{ github.ref }}
override_cache_key_fallback: ${{ runner.os }}-${{ hashFiles('extra.flags') }}
- name: "Workaround GitHub security concerns" # see https://github.com/gap-system/gap/issues/4861
run: git config --global --add safe.directory $PWD
- name: "Configure GAP"
run: ${{ matrix.extra }} dev/ci-configure-gap.sh
- name: "Build GAP"
run: ${{ matrix.extra }} dev/ci-build-gap.sh
- name: "Download packages"
run: ${{ matrix.extra }} dev/ci-download-pkgs.sh
- name: "Setup tmate session"
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
- name: "Run tests"
run: ${{ matrix.extra }} dev/ci.sh
- name: "Upload pdf manuals"
if: ${{ matrix.test-suites == 'makemanuals' }}
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: manuals-pdf
path: |
doc/dev/manual.pdf
doc/hpc/manual.pdf
doc/ref/manual.pdf
doc/tut/manual.pdf
- name: "Upload html manuals"
if: ${{ matrix.test-suites == 'makemanuals' }}
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: manuals-html
path: |
doc/*/*.html
doc/*/*.css
doc/*/*.js
- name: "Gather coverage data"
run: ${{ matrix.extra }} dev/ci-gather-coverage.sh
- name: "Upload coverage data to Codecov"
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
# The following job is duplicated in release.yml - keep the two in sync.
# (except for their different 'needs' components).
slack-notification:
name: Send Slack notification on status change
needs:
- test
if: ${{ always() && github.event_name != 'pull_request' && github.repository == 'gap-system/gap' }}
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: get-branch
run: echo "branch=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Determine whether CI status changed
uses: gap-actions/should-i-notify-action@v1
id: should_notify
with:
branch: ${{ steps.get-branch.outputs.branch }}
needs_context: ${{ toJson(needs) }}
github_token: ${{ secrets.GITHUB_TOKEN }}
notify_on_changed_status: true
- name: Send slack notification
uses: act10ns/slack@v2
if: ${{ steps.should_notify.outputs.should_send_message == 'yes' }}
with:
status: ${{ steps.should_notify.outputs.current_status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}