-
Notifications
You must be signed in to change notification settings - Fork 9
235 lines (224 loc) · 6.88 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
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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
PYTHONIOENCODING: utf-8
PYTHONUNBUFFERED: 1
ATEST_RETRIES: 2
CI: 1
defaults:
run:
# NOTE: some key windows steps _need_ to be run with `cmd /C CALL {0}`
shell: bash -l {0}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-meta-${{
hashFiles('.github/locks/meta/linux-64/conda.lock') }}
restore-keys: |
${{ runner.os }}-conda-meta-
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: meta
environment-file: .github/locks/meta/linux-64/conda.lock
miniforge-variant: Mambaforge
use-mamba: true
use-only-tar-bz2: true
- run: python dodo.py build || python dodo.py build
- uses: actions/upload-artifact@v3
with:
name: dist_${{ github.run_number }}
path: ./dist
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-lint-${{
hashFiles('.github/locks/lint/linux-64/conda.lock') }}
restore-keys: |
${{ runner.os }}-conda-lint-
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: lint
environment-file: .github/locks/lint/linux-64/conda.lock
miniforge-variant: Mambaforge
use-mamba: true
use-only-tar-bz2: true
- run: python dodo.py lint || python dodo.py lint
conda-build:
runs-on: ubuntu-latest
needs: [build, lint, docs]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-meta-${{
hashFiles('.github/locks/meta/linux-64/conda.lock') }}
restore-keys: |
${{ runner.os }}-conda-meta-
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: meta
environment-file: .github/locks/meta/linux-64/conda.lock
miniforge-variant: Mambaforge
use-mamba: true
use-only-tar-bz2: true
- uses: actions/download-artifact@v3
with:
name: dist_${{ github.run_number }}
path: ./dist
- run: python dodo.py conda_build || python dodo.py conda_build
- uses: actions/upload-artifact@v3
with:
name: conda-bld_${{ github.run_number }}
path: ./dist/conda-bld
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-docs-${{
hashFiles('.github/locks/docs/linux-64/conda.lock') }}
restore-keys: |
${{ runner.os }}-conda-docs-
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: docs
environment-file: .github/locks/docs/linux-64/conda.lock
miniforge-variant: Mambaforge
use-mamba: true
use-only-tar-bz2: true
- run: python dodo.py docs || python dodo.py docs
- uses: actions/upload-artifact@v3
with:
name: docs_${{ job.status }}_${{ github.run_number }}
path: ./build/docs/html
if: always()
test:
name: |-
${{ matrix.conda-subdir }}_${{ matrix.python-version }}_${{ matrix.lab-version }}
runs-on: ${{ matrix.vm }}
needs: [build]
env:
INSTALL_ARTIFACT: 1
strategy:
fail-fast: false
# TODO: consider restoring
# max-parallel: 8
matrix:
# The Matrix
#
# This is the single source-of-truth of what we currently support
# - the matrix (with excludes) is parsed in project.py
# - the excursions are in env_specs, e.g. lab1.yml
# - to regenerate the specs, requires `conda-lock`:
#
# rm -rf .github/locks
# doit -n4 lock
#
conda-subdir: [win-64, osx-64, linux-64]
python-version: [py3.7, py3.10]
lab-version: [lab1, lab2, lab3]
include:
- conda-subdir: linux-64
os: ubuntu
vm: ubuntu-latest
- conda-subdir: osx-64
os: macos
vm: macos-latest
- conda-subdir: win-64
os: windows
vm: windows-latest
steps:
- name: configure git
run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- name: get conda lockfile
id: lock
run: |
echo "CI_LOCKFILE=${{
format(
'.github/locks/test/{0}/{1}/{2}/conda.lock',
matrix.conda-subdir,
matrix.python-version,
matrix.lab-version
) }}" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ matrix.python-version }}-${{
hashFiles(env.CI_LOCKFILE) }}
restore-keys: |
${{ runner.os }}-conda-${{ matrix.python-version }}-
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
environment-file: ${{ env.CI_LOCKFILE }}
miniforge-variant: Mambaforge
use-mamba: true
use-only-tar-bz2: true
- if: always()
uses: actions/download-artifact@v3
with:
name: dist_${{ github.run_number }}
path: ./dist
- name: doit (unix)
if: ${{ matrix.os != 'windows' }}
run: python dodo.py test || python dodo.py test
- name: doit (windows)
if: ${{ matrix.os == 'windows' }}
env:
CONDA_EXE: C:\Miniconda\envs\Script\conda.exe
run:
call conda activate test && python dodo.py test || python dodo.py test
shell: cmd /C CALL {0}
- name: upload test output
uses: actions/upload-artifact@v3
with:
name: |
test_${{ job.status }}_${{ matrix.os }}_${{ matrix.python-version }}_${{ matrix.lab-version }}_${{ github.run_number }}
path: |
./build/test/output
if: always()
report:
if: always()
needs: [test, conda-build]
runs-on: ubuntu-latest
steps:
- if: always()
uses: actions/download-artifact@v3
with:
path: ./artifacts
- if: always()
run: find ./artifacts
- if: always()
uses: actions/upload-artifact@v3
with:
name: _COMBINED_${{ github.run_number }}
path: |
./artifacts