185 lines (175 loc) · 5.63 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: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
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: conda-incubator/setup-miniconda@v2
with:
activate-environment: meta
environment-file: .github/locks/meta/linux-64/conda.lock
miniforge-variant: Mambaforge
use-mamba: true
- run: python dodo.py build || python dodo.py build
- uses: actions/upload-artifact@v3
with:
name: rfjl_${{ github.run_number }}_dist
path: ./dist
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
- run: python dodo.py lint || python dodo.py lint
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"
conda-build:
runs-on: ubuntu-latest
needs: [build, lint, docs]
steps:
- uses: actions/checkout@v3
- 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
- uses: actions/download-artifact@v3
with:
name: rfjl_${{ github.run_number }}_dist
path: ./dist
- run: python dodo.py conda_build || python dodo.py conda_build
- uses: actions/upload-artifact@v3
with:
name: rfjl_${{ github.run_number }}_conda-bld
path: ./dist/conda-bld
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
- run: python dodo.py docs || python dodo.py docs
- uses: actions/upload-artifact@v3
with:
name: rfjl_${{ github.run_number }}_docs_${{ job.status }}
path: ./build/docs/html
if: always()
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"
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.8, py3.11]
lab-version: [lab3, lab4]
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: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
environment-file: ${{ env.CI_LOCKFILE }}
miniforge-variant: Mambaforge
use-mamba: true
- if: always()
uses: actions/download-artifact@v3
with:
name: rfjl_${{ github.run_number }}_dist
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: |
rfjl_${{ github.run_number }}_test_${{ job.status }}_${{ matrix.os }}_${{ matrix.python-version }}_${{ matrix.lab-version }}
path: |
./build/test/output
if: always()
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"