-
Notifications
You must be signed in to change notification settings - Fork 51
232 lines (206 loc) · 6.21 KB
/
check.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
name: check
on:
workflow_dispatch:
push:
branches: "main"
pull_request:
schedule:
- cron: "0 8 * * *"
defaults:
run:
shell: bash -l {0}
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: pre-commit/[email protected]
test:
name: test on ${{ matrix.py }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- pypy3.9
steps:
- uses: actions/checkout@v4
- name: setup python for tox
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install tox
run: python -m pip install tox
- name: setup python for test ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Pick environment to run
run: |
import platform; import os; import sys; import codecs
cpy = platform.python_implementation() == "CPython"
base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2])
env = "TOXENV={}\n".format(base)
print("Picked:\n{}for{}".format(env, sys.version))
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
file_handler.write(env)
shell: python
- name: setup test suite for ${{ matrix.py }}
run: tox -vv --notest
- name: run test suite for ${{ matrix.py }}
run: tox --skip-pkg-install
check:
name: check ${{ matrix.tox_env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tox_env:
- pkg_desc
- dev
steps:
- uses: actions/checkout@v4
- name: setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install tox
run: python -m pip install tox
- name: run check for ${{ matrix.tox_env }}
run: python -m tox -e ${{ matrix.tox_env }}
publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [check, test, lint]
runs-on: ubuntu-latest
steps:
- name: setup python to build package
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install build
run: python -m pip install build
- uses: actions/checkout@v4
- name: build package
run: python -m build --sdist --wheel . -o dist
- name: publish to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
user: __token__
password: ${{ secrets.pypi_password }}
build:
runs-on: ubuntu-latest
steps:
- name: setup python to build package
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install build
run: python -m pip install build
- uses: actions/checkout@v4
- name: build package
run: python -m build --sdist --wheel . -o dist
- name: Upload builds
uses: actions/upload-artifact@v3
with:
name: dist ${{ github.run_number }}
path: ./dist
visual-regression-tests-ipw7:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ipydatagrid-test-ipw7
environment-file: test-environment-ipyw7.yaml
auto-activate-base: false
create-args: >-
python=3.9
- uses: actions/download-artifact@v3
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install the package
run: pip install -vv ipydatagrid*.whl
working-directory: dist
- name: Install Galata
run: |
yarn install
yarn playwright install chromium
working-directory: ui-tests-ipw7
- name: Launch JupyterLab
run: yarn run start:detached &
working-directory: ui-tests-ipw7
- name: Wait for JupyterLab
uses: ifaxity/wait-on-action@v1
with:
resource: http-get://localhost:8888/api
timeout: 20000
- name: Run UI Tests
run: yarn run test
working-directory: ui-tests-ipw7
- name: Upload UI Test artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: ui-test-output-ipw7
path: |
ui-tests-ipw7/playwright-report
ui-tests-ipw7/test-results
visual-regression-tests-ipw8:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ipydatagrid-test-ipw8
environment-file: test-environment-ipyw8.yaml
auto-activate-base: false
create-args: >-
python=3.9
- uses: actions/download-artifact@v3
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install the package
run: pip install -vv ipydatagrid*.whl
working-directory: dist
- name: Install dependencies
shell: bash -l {0}
working-directory: ui-tests-ipw8
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install
- name: Install browser
shell: bash -l {0}
run: npx playwright install chromium
working-directory: ui-tests-ipw8
- name: Execute integration tests
shell: bash -l {0}
working-directory: ui-tests-ipw8
run: npx playwright test
- name: Upload UI Test artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: ui-test-output-ipw8
path: |
ui-tests-ipw8/playwright-report
ui-tests-ipw8/test-results