forked from oscar-system/Oscar.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (127 loc) · 4.49 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
name: Run tests
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
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
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
strategy:
fail-fast: false
matrix:
julia-version:
- '1.6'
- '1.9'
- '~1.10.0-0'
- 'nightly'
os:
- ubuntu-latest
include:
# Add a few macOS jobs (not too many, the number we can run in parallel is limited)
- julia-version: 'nightly'
os: macOS-latest
steps:
- uses: actions/checkout@v3
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@v1
with:
version: ${{ matrix.julia-version }}
- name: "Build package"
uses: julia-actions/julia-buildpkg@latest
- 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: "Run tests"
uses: julia-actions/julia-runtest@latest
with:
annotate: ${{ matrix.julia-version == '1.9' }}
coverage: ${{ matrix.julia-version == '1.9' }}
depwarn: error
- name: "Process code coverage"
if: matrix.julia-version == '1.9'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.9'
continue-on-error: true
uses: codecov/codecov-action@v3
doctest:
runs-on: ${{ matrix.os }}
timeout-minutes: 150
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
strategy:
fail-fast: false
matrix:
julia-version:
- '1.9'
- '~1.10.0-0'
- 'nightly'
os:
- ubuntu-latest
include:
# Add macOS jobs (not too many, the number we can run in parallel is limited)
- julia-version: '1.9'
os: macOS-latest
steps:
- uses: actions/checkout@v3
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@v1
with:
version: ${{ matrix.julia-version }}
- name: "Build package"
uses: julia-actions/julia-buildpkg@latest
- 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: "Run tests"
# HACK: since macOS runners are so expensive, we reuse this one to run
# both regular tests and doctests
if: runner.os == 'macOS'
uses: julia-actions/julia-runtest@latest
with:
annotate: ${{ matrix.julia-version == '1.9' }}
coverage: ${{ matrix.julia-version == '1.9' }}
depwarn: error
- name: "Setup package"
run: |
julia --project=docs --color=yes -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: "Run doctests"
run: |
julia --project=docs --depwarn=error --color=yes -e'
using Documenter
using Oscar
DocMeta.setdocmeta!(Oscar, :DocTestSetup, :(using Oscar; Oscar.AbstractAlgebra.set_current_module(@__MODULE__)); recursive = true)
doctest(Oscar)'
- name: "Process code coverage"
if: matrix.julia-version == '1.9'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.9'
continue-on-error: true
uses: codecov/codecov-action@v3