Skip to content

Commit 0119c62

Browse files
committed
try label arrays
1 parent e94d5e3 commit 0119c62

File tree

2 files changed

+133
-0
lines changed

2 files changed

+133
-0
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: OscarCI-selfhosted
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
concurrency:
13+
# group by workflow and ref; the last slightly strange component ensures that for pull
14+
# requests, we limit to 1 concurrent job, but for the master branch we don't
15+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
16+
# Cancel intermediate builds, but only if it is a pull request build.
17+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
18+
19+
jobs:
20+
generatematrix:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
matrix: ${{ steps.set-matrix.outputs.matrix }}
24+
env:
25+
PR_NUMBER: ${{github.event.number || '0' }}
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: "Set up Julia"
30+
uses: julia-actions/setup-julia@v2
31+
with:
32+
version: '1.10'
33+
- name: OscarDevTools - CI
34+
if: github.repository == 'oscar-system/OscarDevTools.jl'
35+
run: |
36+
julia --project=oscar-dev -e "using Pkg;
37+
Pkg.develop(PackageSpec(path=\".\"));
38+
Pkg.instantiate();"
39+
- name: fetch OscarDevTools
40+
if: github.repository != 'oscar-system/OscarDevTools.jl'
41+
run: |
42+
julia --project=oscar-dev -e "using Pkg;
43+
Pkg.add(PackageSpec(name=\"OscarDevTools\",version=\"0.2\"));
44+
Pkg.instantiate();"
45+
- id: set-matrix
46+
run: |
47+
julia --project=oscar-dev -e "using OscarDevTools.OscarCI;
48+
ciprefs = parse_meta(\"OscarCI-selfhosted.toml\");
49+
cimat = ci_matrix(ciprefs;
50+
pr=${PR_NUMBER},
51+
active_repo=\"${GITHUB_REPOSITORY}\");
52+
@show cimat;
53+
println(github_json(cimat));"
54+
55+
test-oscar:
56+
needs: generatematrix
57+
name: ${{ join(matrix.*.name) }} - ${{ matrix.os }}, julia ${{ matrix.julia-version}}
58+
runs-on: ${{ matrix.os }}
59+
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
60+
env:
61+
PR_NUMBER: ${{github.event.number}}
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
strategy:
64+
matrix: ${{fromJSON(needs.generatematrix.outputs.matrix)}}
65+
fail-fast: false
66+
67+
steps:
68+
- uses: actions/checkout@v4
69+
- name: "Set up Julia"
70+
uses: julia-actions/setup-julia@v2
71+
with:
72+
version: ${{ matrix.julia-version }}
73+
- name: re-using OscarDevTools checkout
74+
if: github.repository == 'oscar-system/OscarDevTools.jl'
75+
run: |
76+
julia --project=oscar-dev -e "using Pkg;
77+
Pkg.develop(PackageSpec(path=\".\"));
78+
Pkg.instantiate();"
79+
- name: fetch OscarDevTools
80+
if: github.repository != 'oscar-system/OscarDevTools.jl'
81+
run: |
82+
julia --project=oscar-dev -e "using Pkg;
83+
Pkg.add(PackageSpec(name=\"OscarDevTools\",version=\"0.2\"));
84+
Pkg.instantiate();"
85+
- name: "Set up Oscar-dev configuration"
86+
id: setupdev
87+
env:
88+
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
89+
run: |
90+
echo "$MATRIX_CONTEXT"
91+
julia --project=oscar-dev -e "using OscarDevTools, OscarDevTools.OscarCI;
92+
meta = job_meta_env(\"MATRIX_CONTEXT\");
93+
oscar_develop(job_pkgs(meta);
94+
dir=\"oscar-dev\",
95+
active_repo=\"${GITHUB_REPOSITORY}\");
96+
github_env_runtests(meta;
97+
varname=\"oscar_run_tests\",
98+
filename=\"${GITHUB_ENV}\");
99+
github_env_run_doctests(meta;
100+
varname=\"oscar_run_doctests\",
101+
filename=\"${GITHUB_ENV}\");"
102+
103+
- name: "Run tests"
104+
if: steps.setupdev.outputs.skiptests != 'true'
105+
run: |
106+
echo '${{ env.oscar_run_tests }}'
107+
julia --project=oscar-dev/project/ -e '${{ env.oscar_run_tests }}'
108+
- name: "Run doctests"
109+
if: steps.setupdev.outputs.skiptests != 'true'
110+
run: |
111+
echo '${{ env.oscar_run_doctests }}'
112+
julia --project=oscar-dev/project/ -e '${{ env.oscar_run_doctests }}'

test/meta/OscarCI-selfhosted.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
title = "metadata for oscar CI run"
2+
3+
# defaults for os, julia-version, and branches are set in OscarDevTools
4+
# '<matching>' will try to look up a matching branch for the branch of
5+
# the pull request and use master if that cannot be found
6+
[env]
7+
os = [ [ "Linux", "RPTU" ], "ubuntu-latest" ]
8+
julia-version = [ "~1.10.0-0" ]
9+
branches = [ "<matching>" ]
10+
11+
# pkgs without branches specified will use the global branches axis
12+
# and not expand separately
13+
[pkgs]
14+
[pkgs.Oscar]
15+
test = true
16+
testoptions = []
17+
18+
[pkgs.Singular]
19+
branches = []
20+
test = true
21+
testoptions = []

0 commit comments

Comments
 (0)