-
Notifications
You must be signed in to change notification settings - Fork 148
174 lines (151 loc) · 5.24 KB
/
test.yaml
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
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
#
name: Test
on:
pull_request:
paths-ignore:
- "docs/**"
- "contrib/**"
- "**.md"
- ".github/workflows/*"
- "!.github/workflows/test.yaml"
push:
paths-ignore:
- "docs/**"
- "contrib/**"
- "**.md"
- ".github/workflows/*"
- "!.github/workflows/test.yaml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
workflow_dispatch:
env:
# avoid warnings about config paths
JUPYTER_PLATFORM_DIRS: "1"
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20.x
registry-url: https://registry.npmjs.org
cache-dependency-path: labextension/yarn.lock
- name: Update root build packages
run: pip install --upgrade build
- name: Build Python package
run: pyproject-build
- name: Upload built artifacts
uses: actions/upload-artifact@v3
with:
name: dist-${{ github.run_number }}
path: ./dist
test:
name: |-
${{ matrix.os }}
${{ matrix.python-version }}
s${{ matrix.jupyter_server-version }}
lab${{ matrix.jupyterlab-version }}
nb${{ matrix.notebook-version }}
needs: [build]
timeout-minutes: 30
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash # windows default isn't bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
python-version: ["3.8", "3.11"]
jupyter_server-version: ["1", "2"]
jupyterlab-version: ["3", "4"]
include:
# let jupyterlab-version 3 and 4 imply notebook-version 6 and 7
# respectively, to avoid doubling the amount of test runs
- jupyterlab-version: "3"
notebook-version: "6"
- jupyterlab-version: "4"
notebook-version: "7"
# windows should work for all test variations, but a limited selection
# is run to avoid doubling the amount of test runs
- os: windows-2022
python-version: "3.8"
jupyter_server-version: "1"
jupyterlab-version: "3"
notebook-version: "6"
- os: windows-2022
python-version: "3.11"
jupyter_server-version: "2"
jupyterlab-version: "4"
notebook-version: "7"
exclude:
# jupyterlab-version 4 requires jupyter_server-version 2
- jupyter_server-version: "1"
jupyterlab-version: "4"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Update root build packages
run: pip install --upgrade pip
- name: Download built artifacts
uses: actions/download-artifact@v3
with:
name: dist-${{ github.run_number }}
path: ./dist
- name: Install Python package
# NOTE: See CONTRIBUTING.md for a local development setup that differs
# slightly from this.
#
# Pytest options are set in `pyproject.toml`.
run: |
pip install -vv $(ls ./dist/*.whl)\[acceptance\] 'jupyterlab~=${{ matrix.jupyterlab-version }}.0' 'jupyter_server~=${{ matrix.jupyter_server-version }}.0' 'notebook~=${{ matrix.notebook-version }}.0'
- name: List Python packages
run: |
pip freeze
pip check
- name: Check server extension for jupyter_server
run: |
jupyter server extension list
jupyter server extension list 2>&1 | grep -iE "jupyter_server_proxy.*OK" -
- name: Check server extension for notebook v6
if: matrix.notebook-version == '6'
run: |
jupyter serverextension list
jupyter serverextension list 2>&1 | grep -iE "jupyter_server_proxy.*OK" -
- name: Check frontend extension for notebook v6
if: matrix.notebook-version == '6'
run: |
jupyter nbextension list
PYTHONUNBUFFERED=1 jupyter nbextension list 2>&1 | grep -A1 -iE '.*jupyter_server_proxy.*enabled' | grep -B1 -iE "Validating.*OK"
- name: Check frontend extension for notebook v7+
if: matrix.notebook-version != '6'
run: |
jupyter notebook extension list
jupyter notebook extension list 2>&1 | grep -iE 'jupyter_server_proxy.*OK.*'
- name: Check frontend extension for jupyterlab
run: |
jupyter lab extension list
jupyter lab extension list 2>&1 | grep -iE 'jupyter_server_proxy.*OK.*'
- name: Run tests
run: |
pytest
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v3
with:
name: |-
tests-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.jupyterlab-version }}-${{ github.run_number }}
path: |
./build/pytest
./build/coverage
./build/robot