forked from jupyterlite/jupyterlite
-
Notifications
You must be signed in to change notification settings - Fork 0
261 lines (251 loc) · 8.39 KB
/
build.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- '*'
env:
CACHE_EPOCH: 3
jobs:
build:
runs-on: ubuntu-latest
env:
BUILDING_IN_CI: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build dist
uses: ./.github/actions/build-dist
- name: Upload (dist)
uses: actions/upload-artifact@v4
with:
name: jupyterlite dist ${{ github.run_number }}
path: ./dist
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Cache (pip)
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-lint-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-lint-
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -r requirements-lint.txt
jlpm
- name: Lint
run: jlpm lint:check
integrity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install -r requirements-lint.txt
jlpm
- name: Repo Integrity
shell: bash -el {0}
run: |
doit repo:integrity:check
typedoc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install -r requirements-build.txt
jlpm
- name: Docs (typedoc)
run: doit -n4 docs:typedoc:mystify
- name: Upload (typedoc)
uses: actions/upload-artifact@v4
with:
name: jupyterlite typedoc ${{ github.run_number }}
path: ./docs/reference/api/ts
test:
needs: [build]
runs-on: ${{ matrix.os }}-latest
env:
TESTING_IN_CI: 1
PYTEST_ARGS: ${{ matrix.pytest-args }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
python-version: ['3.8', '3.11', 'pypy-3.8']
include:
# OS-specifics for running pip
- os: ubuntu
pip-cache: ~/.cache/pip
python-command: python3
- os: macos
pip-cache: ~/Library/Caches/pip
python-command: python3
- os: windows
pip-cache: ~\AppData\Local\pip\Cache
python-command: python
# python-specifics for tests
- python-version: '3.8'
pytest-args: '[]'
- python-version: '3.11'
pytest-args: '[]'
- python-version: 'pypy-3.8'
# TODO: some instability with libarchive, might be better with pypy-3.8
# after https://github.com/cloudpipe/cloudpickle/pull/461
pytest-args: '["-k", "not _archive_is_"]'
exclude:
- os: windows
python-version: pypy-3.8
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup pip (base)
run: ${{ matrix.python-command }} -m pip install --user -U pip setuptools wheel
- name: Download (dist)
uses: actions/download-artifact@v4
with:
name: jupyterlite dist ${{ github.run_number }}
path: ./dist
- name: Cache (pip)
uses: actions/cache@v4
with:
path: ${{ matrix.pip-cache }}
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-test-${{ matrix.python-version }}-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-test-${{ matrix.python-version }}-
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-test-
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-
- name: Install (py)
run: |
${{ matrix.python-command }} -m pip install importlib_metadata 'doit >=0.34,<1' jupyter_core
${{ matrix.python-command }} -m pip install --find-links dist --no-index jupyterlite_core
${{ matrix.python-command }} -m pip check
- name: Prepare smoke test folder
shell: bash
run: mkdir -p build/smoke-test
- name: Get SOURCE_DATE_EPOCH
id: source-date
shell: bash -eux {0}
run: |
echo "epoch=$(git log -1 --format=%ct)" >> $GITHUB_OUTPUT
- name: Test (CLI)
run: |
cd build/smoke-test
jupyter lite --version || exit 1
jupyter lite --help || exit 1
jupyter lite list || exit 1
jupyter lite status || exit 1
jupyter lite build || exit 1
jupyter lite check || exit 1
jupyter lite archive --source-date-epoch ${{ steps.source-date.outputs.epoch }} || exit 1
jupyter lite list || exit 1
jupyter lite status --debug || exit 1
- name: Setup pip (test)
run: ${{ matrix.python-command }} -m pip install -r requirements-test.txt
- name: Pin pytest for pypy
if: ${{ matrix.python-version == 'pypy-3.8' }}
run: |
${{ matrix.python-command }} -m pip install "pytest<8"
echo 'See https://github.com/jupyterlite/jupyterlite/issues/1308' >> $GITHUB_STEP_SUMMARY
- name: Test (py)
run: doit test:py:*
- name: Upload (reports)
if: always()
uses: actions/upload-artifact@v4
with:
name: |
jupyterlite reports ${{ github.run_number }} ${{ matrix.os }} ${{ matrix.python-version }}
path: |
build/htmlcov
build/pytest
docs:
needs: [build, typedoc]
runs-on: ubuntu-latest
env:
DOCS_IN_CI: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download (dist)
uses: actions/download-artifact@v4
with:
name: jupyterlite dist ${{ github.run_number }}
path: ./dist
- name: Download (typedoc)
uses: actions/download-artifact@v4
with:
name: jupyterlite typedoc ${{ github.run_number }}
path: ./docs/reference/api/ts
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Cache (pip)
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-docs-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-docs-
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-
- name: Cache (docs extensions)
uses: actions/cache@v4
with:
path: ./examples/.cache
key: |
${{ env.CACHE_EPOCH }}-docs-app-${{ hashFiles('examples/*.json') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-docs-app-
- name: Setup pip (docs)
run: python3 -m pip install -r requirements-docs.txt
- name: Install (py)
run: doit dev:py:jupyterlite-core
- name: Install dependencies
run: jlpm
- name: Docs (app)
run: doit docs:app:build
- name: Docs (app archive)
run: doit docs:app:pack
- name: Upload (docs app archive)
uses: actions/upload-artifact@v4
with:
name: jupyterlite docs archive ${{ github.run_number }}
path: |
build/docs-app/jupyterlite-docs-*.tgz
- name: Docs (sphinx)
run: doit docs:sphinx
- name: Check Built Artifacts
run: doit check
- name: Test (py)
run: doit test:py:jupyterlite-core
- name: Upload (reports)
if: always()
uses: actions/upload-artifact@v4
with:
name: |
jupyterlite reports ${{ github.run_number }} ${{ matrix.os }} ${{ matrix.python-version }}
path: |
build/htmlcov
build/pytest
- name: Upload (sphinx logs)
if: always()
uses: actions/upload-artifact@v4
with:
name: jupyterlite sphinx logs ${{ github.run_number }}
if-no-files-found: ignore
path: /tmp/sphinx-*.log