-
Notifications
You must be signed in to change notification settings - Fork 126
185 lines (178 loc) · 6.83 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
name: Run tests
on:
push:
branches:
- master
- 'release-*'
pull_request:
schedule:
# Every day at 3:10 AM UTC
- cron: '10 3 * * *'
workflow_dispatch:
# 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 }}
timeout-minutes: 150
strategy:
fail-fast: false
matrix:
julia-version:
- '1.6'
- '1.10'
- '1.11-nightly'
- 'nightly'
group: [ 'short', 'long' ]
os:
- ubuntu-latest
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: ubuntu-latest
depwarn: 'depwarn=error'
- julia-version: '1.10'
group: 'long'
os: ubuntu-latest
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
- julia-version: '1.10'
group: 'book'
os: ubuntu-latest
# 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@v4
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@v2
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v2
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: "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 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: "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@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
doctest:
runs-on: ${{ matrix.os }}
timeout-minutes: 150
strategy:
fail-fast: false
matrix:
julia-version:
- '1.10'
- '1.11-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@v4
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@v2
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v2
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: "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)'
- 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@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}