Debian Codegraph @

bqplot/.github/workflows/build.yml

raw
1 name: Build
2
3 on:
4 push:
5 branches: [ master ]
6 pull_request:
7 branches: '*'
8
9 env:
10 PIP_DISABLE_PIP_VERSION_CHECK: 1
11
12 defaults:
13 run:
14 shell: bash -l {0}
15
16 jobs:
17 build:
18 runs-on: ubuntu-20.04
19 steps:
20
21 - name: Checkout
22 uses: actions/checkout@v3
23
24 - name: Install Conda environment with Micromamba
25 uses: mamba-org/provision-with-micromamba@main
26 with:
27 environment-name: bqplot-test
28 environment-file: test-environment.yml
29 python-version: ${{ matrix.python-version }}
30 mamba-version: "*"
31 auto-activate-base: false
32 channels: conda-forge
33
34 - name: Install the package
35 run: |
36 pip install .
37
38 - name: Test installation files
39 run: |
40 test -d $CONDA_PREFIX/share/jupyter/nbextensions/bqplot
41 test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/extension.js
42 test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/index.js
43 test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot
44 test -f $CONDA_PREFIX/share/jupyter/labextensions/bqplot/package.json
45 test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot/static
46
47 - name: Validate the nbextension
48 run: jupyter nbextension list 2>&1 | grep "bqplot/extension"
49
50 - name: Validate the labextension
51 run: jupyter labextension list 2>&1 | grep bqplot
52
53 - name: Discover typos with codespell
54 run: codespell --ignore-words-list="afterall,curvelinear,hist" --skip="./share,./.git/*,./js/node_modules/*,./js/dist/*,*.csv,*.json,*.lock,*.map"
55
56 - name: Python PEP8 check
57 run: flake8 bqplot --ignore=E501,W504,W503
58
59 - name: JavaScript prettyfier
60 run: |
61 yarn install
62 yarn run prettier --check .
63 working-directory: js
64
65 - name: Python tests
66 run: pytest tests examples/Marks
67
68 - name: JavaScript tests
69 run: yarn run test
70 working-directory: js
71
72 - name: Build Python package
73 run: |
74 python setup.py sdist bdist_wheel
75 cd dist
76 sha256sum * | tee SHA256SUMS
77
78 - name: Pack JavaScript package
79 run: |
80 yarn pack
81 mv bqplot*.tgz ../dist
82 working-directory: js
83
84 - name: Upload builds
85 uses: actions/upload-artifact@v3
86 with:
87 name: dist ${{ github.run_number }}
88 path: ./dist
89
90 visual-regression-tests:
91 runs-on: ubuntu-20.04
92 needs: [build]
93
94 steps:
95 - name: Checkout
96 uses: actions/checkout@v3
97
98 - name: Install Conda environment with Micromamba
99 uses: mamba-org/provision-with-micromamba@main
100 with:
101 environment-name: bqplot-test
102 environment-file: test-environment.yml
103 python-version: 3.9
104 mamba-version: "*"
105 auto-activate-base: false
106 channels: conda-forge
107
108 - uses: actions/download-artifact@v3
109 with:
110 name: dist ${{ github.run_number }}
111 path: ./dist
112
113 - name: Install the package
114 run: pip install -vv bqplot*.whl
115 working-directory: dist
116
117 - name: Install Galata
118 run: |
119 yarn install
120 yarn playwright install chromium
121 working-directory: ui-tests
122
123 - name: Launch JupyterLab
124 run: yarn run start:detached
125 working-directory: ui-tests
126
127 - name: Wait for JupyterLab
128 uses: ifaxity/wait-on-action@v1
129 with:
130 resource: http-get://localhost:8888/api
131 timeout: 20000
132
133 - name: Run UI Tests
134 run: yarn run test
135 working-directory: ui-tests
136
137 - name: Upload UI Test artifacts
138 if: always()
139 uses: actions/upload-artifact@v3
140 with:
141 name: ui-test-output
142 path: ui-tests/playwright-report
143
144 - name: Update snapshots
145 if: failure()
146 run: |
147 cd ui-tests
148 yarn run test:update
149
150 - name: Upload updated snapshots
151 if: failure()
152 uses: actions/upload-artifact@v2
153 with:
154 name: ipywidgets-updated-snapshots
155 path: ui-tests/tests
156
157 install:
158 runs-on: ${{ matrix.os }}-latest
159 needs: [build]
160
161 strategy:
162 fail-fast: false
163 matrix:
164 os: [ubuntu, macos, windows]
165 python: ['3.6', '3.9']
166 include:
167 - python: '3.6'
168 dist: 'bqplot*.tar.gz'
169 - python: '3.9'
170 dist: 'bqplot*.whl'
171
172 steps:
173
174 - name: Checkout
175 uses: actions/checkout@v3
176
177 - name: Install Conda environment with Micromamba
178 uses: mamba-org/provision-with-micromamba@main
179 with:
180 environment-name: bqplot-test
181 environment-file: test-environment.yml
182 python-version: ${{ matrix.python-version }}
183 mamba-version: "*"
184 auto-activate-base: false
185 channels: conda-forge
186
187 - uses: actions/download-artifact@v3
188 with:
189 name: dist ${{ github.run_number }}
190 path: ./dist
191
192 - name: Install the package
193 run: |
194 cd dist
195 pip install -vv ${{ matrix.dist }}
196
197 - name: Test installation files
198 run: |
199 test -d $CONDA_PREFIX/share/jupyter/nbextensions/bqplot
200 test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/extension.js
201 test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/index.js
202 test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot
203 test -f $CONDA_PREFIX/share/jupyter/labextensions/bqplot/package.json
204 test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot/static
205
206 - name: Validate the nbextension
207 run: jupyter nbextension list 2>&1 | grep "bqplot/extension"
208
209 - name: Validate the labextension
210 run: jupyter labextension list 2>&1 | grep bqplot
211
212 JupyterLab2-build:
213 runs-on: ${{ matrix.os }}-latest
214 needs: [build]
215
216 strategy:
217 fail-fast: false
218 matrix:
219 os: [ubuntu]
220 python: ['3.9']
221
222 steps:
223
224 - name: Checkout
225 uses: actions/checkout@v2
226
227 - name: Install Conda environment with Micromamba
228 uses: mamba-org/provision-with-micromamba@main
229 with:
230 python-version: ${{ matrix.python-version }}
231 mamba-version: "*"
232 channels: conda-forge
233
234 - uses: actions/download-artifact@v2
235 with:
236 name: dist ${{ github.run_number }}
237 path: ./dist
238
239 - name: Install JupyterLab 2
240 run: micromamba install yarn jupyterlab=2
241
242 - name: Install the labextension
243 env:
244 NODE_OPTIONS: --openssl-legacy-provider
245 run: jupyter labextension install dist/bqplot*.tgz --debug