-
Notifications
You must be signed in to change notification settings - Fork 63
115 lines (109 loc) · 4.48 KB
/
hecke.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
name: HeckeCI
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
# Every day at 3:09 AM UTC
- cron: '9 3 * * *'
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:
generatematrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
env:
PR_NUMBER: ${{github.event.number || '0' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: "Set up Julia"
uses: julia-actions/setup-julia@v2
with:
version: '1.10'
- name: OscarDevTools - CI
if: github.repository == 'oscar-system/OscarDevTools.jl'
run: |
julia --project=oscar-dev -e "using Pkg;
Pkg.develop(PackageSpec(path=\".\"));
Pkg.instantiate();"
- name: fetch OscarDevTools
if: github.repository != 'oscar-system/OscarDevTools.jl'
run: |
julia --project=oscar-dev -e "using Pkg;
Pkg.add(PackageSpec(name=\"OscarDevTools\",version=\"0.2\"));
Pkg.instantiate();"
- id: set-matrix
run: |
julia --project=oscar-dev -e "using OscarDevTools.OscarCI;
ciprefs = parse_meta(\"HeckeCI.toml\");
cimat = ci_matrix(ciprefs;
pr=${PR_NUMBER},
active_repo=\"${GITHUB_REPOSITORY}\");
@show cimat;
println(github_json(cimat));"
test-oscar:
needs: generatematrix
name: ${{ join(matrix.*.name) }} - ${{ matrix.os }}, julia ${{ matrix.julia-version}}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
env:
PR_NUMBER: ${{github.event.number}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix: ${{fromJSON(needs.generatematrix.outputs.matrix)}}
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: "Set up Julia"
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
- name: re-using OscarDevTools checkout
if: github.repository == 'oscar-system/OscarDevTools.jl'
run: |
julia --project=oscar-dev -e "using Pkg;
Pkg.develop(PackageSpec(path=\".\"));
Pkg.instantiate();"
- name: fetch OscarDevTools
if: github.repository != 'oscar-system/OscarDevTools.jl'
run: |
julia --project=oscar-dev -e "using Pkg;
Pkg.add(PackageSpec(name=\"OscarDevTools\",version=\"0.2\"));
Pkg.instantiate();"
- name: "Set up Oscar-dev configuration"
id: setupdev
env:
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
run: |
echo "$MATRIX_CONTEXT"
julia --project=oscar-dev -e "using OscarDevTools, OscarDevTools.OscarCI;
meta = job_meta_env(\"MATRIX_CONTEXT\");
oscar_develop(job_pkgs(meta);
dir=\"oscar-dev\",
active_repo=\"${GITHUB_REPOSITORY}\");
github_env_runtests(meta;
varname=\"oscar_run_tests\",
filename=\"${GITHUB_ENV}\");
github_env_run_doctests(meta;
varname=\"oscar_run_doctests\",
filename=\"${GITHUB_ENV}\");"
- name: "Run tests"
if: steps.setupdev.outputs.skiptests != 'true'
run: |
echo '${{ env.oscar_run_tests }}'
julia --color=yes --project=oscar-dev/project/ -e '${{ env.oscar_run_tests }}'
- name: "Run doctests"
if: steps.setupdev.outputs.skiptests != 'true'
run: |
echo '${{ env.oscar_run_doctests }}'
julia --color=yes --project=oscar-dev/project/ -e '${{ env.oscar_run_doctests }}'