-
Notifications
You must be signed in to change notification settings - Fork 180
428 lines (414 loc) · 15.9 KB
/
Copy pathCI.yml
File metadata and controls
428 lines (414 loc) · 15.9 KB
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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
name: Run tests
on:
push:
branches:
- master
- 'release-*'
paths-ignore:
- '*.md'
- '.github/workflows/changelog.yml'
- 'dev/releases/release_notes.py'
pull_request:
paths-ignore:
- '*.md'
- '.github/workflows/changelog.yml'
- 'dev/releases/release_notes.py'
schedule:
# Every day at 3:10 AM UTC
- cron: '10 3 * * *'
workflow_dispatch:
inputs:
extralong:
type: boolean
default: false
description: Run extra long test set
dualdepot:
type: boolean
default: false
description: Run test suite in dual depot runner
# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read
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/') }}
jobs:
test:
runs-on: ["${{ matrix.os }}", "${{ matrix.group == 'short' && 'high-memory' || 'normal-memory'}}", RPTU]
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
julia-version:
- '1.10'
- '1.12'
- '1.13-nightly'
- 'nightly'
group: [ 'short', 'long' ]
os: [Linux]
depwarn: [ '' ]
include:
# Add a single job per group with deprecation errors on the most recent stable julia version
- julia-version: '1.10'
group: 'short'
os: [Linux, RPTU, high-memory]
depwarn: 'depwarn=error'
- julia-version: '1.10'
group: 'long'
os: [Linux, RPTU, normal-memory]
depwarn: 'depwarn=error'
# Add a few macOS jobs (not too many, the number we can run in parallel is limited)
- julia-version: '1.10'
group: 'short'
os: [macOS, RPTU] # runs on self-hosted runner
- julia-version: '1.10'
group: 'long'
os: [macOS, RPTU] # runs on self-hosted runner
# nightly on macos is disabled for now since the macos jobs take too long
# with just 5 runners
#- julia-version: 'nightly'
# group: 'short'
# os: macOS-latest
#- julia-version: 'nightly'
# group: 'long'
# os: macOS-latest
steps:
- uses: actions/checkout@v7
with:
# For Codecov, we must also fetch the parent of the HEAD commit to
# be able to properly deal with PRs / merges
fetch-depth: 2
- name: "Set up Julia"
id: setup-julia
uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v3
id: julia-cache
if: runner.environment != 'self-hosted'
with:
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }}
include-matrix: false
- name: "Clean polymake scratchspace for self-hosted macOS runners"
if: runner.environment == 'self-hosted'
run: rm -rf $JULIA_DEPOT_PATH/scratchspaces/d720cf60-89b5-51f5-aff5-213f193123e7
- name: "Build package"
uses: julia-actions/julia-buildpkg@v1
- name: "limit OpenMP threads"
if: runner.os == 'macOS'
# restrict number of openMP threads on macOS due to oversubscription
run: echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV
- name: "Use multiple processes for self-hosted macOS runners"
if: runner.os == 'macOS' && runner.environment == 'self-hosted'
# runner.environment is supposed to be a valid property: https://github.com/orgs/community/discussions/48359#discussioncomment-9059557
run: echo "NUMPROCS=5" >> $GITHUB_ENV
- name: "set test subgroup"
if: matrix.group != ''
run: echo "OSCAR_TEST_SUBSET=${{matrix.group}}" >> $GITHUB_ENV
- name: "Run tests"
uses: julia-actions/julia-runtest@latest
with:
annotate: ${{ matrix.julia-version == '1.10' }}
coverage: ${{ matrix.julia-version == '1.10' }}
depwarn: ${{ matrix.depwarn == 'depwarn=error' && 'error' || 'no' }}
- name: Archive stats
if: matrix.depwarn == ''
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: stats-${{ matrix.group }}-${{ join(matrix.os) }}-${{ matrix.julia-version }}
path: |
test-stats_*.csv
- name: "Process code coverage"
if: matrix.julia-version == '1.10' && matrix.depwarn != 'depwarn=error'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.10' && matrix.depwarn != 'depwarn=error'
continue-on-error: true
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
book-tests:
runs-on: 'ubuntu-latest'
timeout-minutes: 80
strategy:
fail-fast: false
matrix:
julia-version:
- '1.10'
- 'pre'
- 'nightly'
steps:
- uses: actions/checkout@v7
with:
# For Codecov, we must also fetch the parent of the HEAD commit to
# be able to properly deal with PRs / merges
fetch-depth: 2
- name: "Set up Julia"
id: setup-julia
uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v3
id: julia-cache
if: runner.environment != 'self-hosted'
with:
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }}
include-matrix: false
- name: "Build package"
uses: julia-actions/julia-buildpkg@v1
- name: "set test subgroup"
run: echo "OSCAR_TEST_SUBSET=book" >> $GITHUB_ENV
- name: "Run tests"
uses: julia-actions/julia-runtest@latest
with:
annotate: ${{ matrix.julia-version == '1.10' }}
coverage: ${{ matrix.julia-version == '1.10' }}
- name: Archive stats
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: stats-book-${{ runner.os }}-${{ matrix.julia-version }}
path: |
test-stats_*.csv
- name: "Process code coverage"
if: matrix.julia-version == '1.10'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.10'
continue-on-error: true
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
extra-long-test:
# Extra long tests
# Only happens during the daily run, triggered by schedule
if: ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.extralong ) || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'extra-long') ) }}
runs-on: [Linux, RPTU, high-memory]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 2
- name: "Set up Julia"
id: setup-julia
uses: julia-actions/setup-julia@v3
with:
version: "1.10"
- name: "Build package"
uses: julia-actions/julia-buildpkg@v1
- name: "reduce concurrent jobs"
if: runner.environment == 'self-hosted'
run: echo "NUMPROCS=4" >> $GITHUB_ENV
- name: "set test subgroup"
run: echo "OSCAR_TEST_SUBSET=extra_long" >> $GITHUB_ENV
- name: "Run tests"
uses: julia-actions/julia-runtest@latest
doctest:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
julia-version:
- '1.10'
- '1.12'
- '1.13-nightly'
- 'nightly'
os:
- 'ubuntu-latest'
depwarn: [ '' ]
include:
# Add a single job with deprecation errors on the most recent stable julia version
- julia-version: '1.10'
os: 'ubuntu-latest'
depwarn: 'depwarn=error'
# Add macOS jobs (not too many, the number we can run in parallel is limited)
- julia-version: '1.10'
os: [macOS, RPTU] # runs on self hosted runner
steps:
- uses: actions/checkout@v7
with:
# For Codecov, we must also fetch the parent of the HEAD commit to
# be able to properly deal with PRs / merges
fetch-depth: 2
- name: "Set up Julia"
uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v3
id: julia-cache
if: runner.environment != 'self-hosted'
with:
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }}
include-matrix: false
- name: "Clean polymake scratchspace for self-hosted macOS runners"
if: runner.environment == 'self-hosted'
run: rm -rf $JULIA_DEPOT_PATH/scratchspaces/d720cf60-89b5-51f5-aff5-213f193123e7
- name: "Build package"
uses: julia-actions/julia-buildpkg@v1
- name: "limit OpenMP threads"
if: runner.os == 'macOS'
# restrict number of openMP threads on macOS due to oversubscription
run: echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV
- name: "Setup package"
run: |
julia --project=docs --color=yes -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: "Run doctests"
run: |
julia ${{ matrix.julia-version == '1.10' && '--code-coverage' || '' }} \
--project=docs --depwarn=${{ matrix.depwarn == 'depwarn=error' && 'error' || 'no' }} --color=yes -e'
using Documenter
include("docs/documenter_helpers.jl")
using Oscar
DocMeta.setdocmeta!(Oscar, :DocTestSetup, Oscar.doctestsetup(); recursive = true)
doctest(Oscar; doctestfilters=Oscar.doctestfilters())'
- name: Archive stats
if: matrix.depwarn == ''
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: stats-doctest-${{ join(matrix.os) }}-${{ matrix.julia-version }}
path: |
test-stats_*.csv
- name: "Process code coverage"
if: matrix.julia-version == '1.10' && matrix.depwarn != 'depwarn=error'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.10' && matrix.depwarn != 'depwarn=error'
continue-on-error: true
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
test-mongodb:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ contains(matrix.julia-version, 'nightly') }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
julia-version:
- '1.10'
- '1.12'
- '1.13-nightly'
- 'nightly'
os: ['ubuntu-latest']
# Service containers to run
services:
# Label used to access the service container
mongodb:
# Docker Hub image
image: mongo:6.0
# Provide the login data
env:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
ports:
# Maps tcp port 27017 on service container to the host
- 27017:27017
env:
OSCARDB_TEST_URI: "mongodb://admin:admin@localhost:27017/?authSource=admin"
OSCAR_TEST_SUBSET: "oscar_db"
steps:
- uses: actions/checkout@v7
- name: "Set up Julia"
uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v3
with:
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }}
include-matrix: false
cache-scratchspaces: false
- name: "Fill OscarDB container"
run: |
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-database-tools
mongorestore --host localhost -u admin -p admin --port 27017 .github/oscardb_dump
- uses: julia-actions/julia-runtest@v1
with:
annotate: ${{ matrix.julia-version == '1.10' }}
coverage: ${{ matrix.julia-version == '1.10' }}
- name: "Process code coverage"
if: matrix.julia-version == '1.10'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.10'
continue-on-error: true
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
test-dual-depot:
# run tests in dual depot runner, where the RO depot has most of the depot, and the RW depot is
# only for running the tests
# this helps guard against errors like https://github.com/oscar-system/GAP.jl/issues/1371
# JULIA_DEPOT_RO and JULIA_DEPOT_RW are env vars defined in the systemd unit
name: Run testsuite in a dual depot runnner
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.dualdepot) }}
runs-on: [RPTU,dual-depot]
continue-on-error: true
steps:
- name: Checkout repo
uses: actions/checkout@v7
# setup first depot
- name: Set RO Depot
run: echo "JULIA_DEPOT_PATH=$JULIA_DEPOT_RO" >> $GITHUB_ENV
- name: Set up julia
uses: julia-actions/setup-julia@v3
- name: "Build package"
uses: julia-actions/julia-buildpkg@v1
# mark RO depot as RO
- name: Mark first depot as RO
run: chmod -Rv a-w $JULIA_DEPOT_PATH
# set second depot
- name: Make RW depot
# this assumes that the second variable in $GITHUB_ENV wins!
# we don't know for sure!
run: echo "JULIA_DEPOT_PATH=$JULIA_DEPOT_RW:$JULIA_DEPOT_RO" >> $GITHUB_ENV
- name: "set test subgroup"
run: echo "OSCAR_TEST_SUBSET=short" >> $GITHUB_ENV
- name: Run tests
uses: julia-actions/julia-runtest@latest
# adapted from gap-system/gap
slack-notification:
name: Send Slack notification on status change
needs:
- extra-long-test
if: "!cancelled() && github.event_name == 'schedule'"
runs-on: ubuntu-slim
steps:
- name: Get branch name
id: get-branch
run: echo "branch=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Determine whether CI status changed
uses: oscar-system/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: '' # notify each time on failure, and also once when the status changes to success
event: ${{ github.event_name }}
- 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 }}