Skip to content

Commit 5cb80e8

Browse files
authored
Merge pull request #7 from martinRenou/actions
Add Github actions
2 parents 6a11e4c + 12e1b03 commit 5cb80e8

3 files changed

Lines changed: 235 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
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-latest
19+
steps:
20+
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
with:
27+
repository: 'martinRenou/bqplot'
28+
ref: 'get_rid_webgl'
29+
path: 'bqplot'
30+
31+
- name: Setup conda
32+
uses: conda-incubator/setup-miniconda@v2
33+
with:
34+
activate-environment: bqplot-gl-test
35+
environment-file: test-environment.yml
36+
python-version: ${{ matrix.python-version }}
37+
mamba-version: "*"
38+
auto-activate-base: false
39+
channels: conda-forge
40+
41+
- name: Install bqplot
42+
run: pip install .
43+
working-directory: bqplot
44+
45+
- name: Yarn build bqplot
46+
run: |
47+
yarn install
48+
yarn run build
49+
working-directory: bqplot/js
50+
51+
- name: Yarn install bqplot-gl
52+
run: yarn install
53+
54+
- name: Patch node_modules/bqplot
55+
run: |
56+
rm -rf bqplot
57+
ln -s $GITHUB_WORKSPACE/bqplot/js bqplot
58+
ls bqplot
59+
working-directory: node_modules
60+
61+
- name: Yarn build
62+
run: yarn run build
63+
64+
- name: Install bqplot-gl
65+
run: pip install .
66+
67+
- name: Test installation files
68+
run: |
69+
test -d $CONDA_PREFIX/share/jupyter/nbextensions/bqplot-gl
70+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot-gl/extension.js
71+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot-gl/index.js
72+
test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot-gl
73+
test -f $CONDA_PREFIX/share/jupyter/labextensions/bqplot-gl/package.json
74+
test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot-gl/static
75+
76+
- name: Validate the nbextension
77+
run: jupyter nbextension list 2>&1 | grep "bqplot-gl/extension"
78+
79+
- name: Validate the labextension
80+
run: jupyter labextension list 2>&1 | grep bqplot-gl
81+
82+
- name: Python PEP8 check
83+
run: flake8 bqplot_gl --ignore=E501,W504,W503
84+
85+
- name: JavaScript prettyfier
86+
run: yarn run prettier:check
87+
88+
# - name: JavaScript tests
89+
# run: yarn run test
90+
# working-directory: js
91+
92+
- name: Build Python package
93+
run: |
94+
python setup.py sdist bdist_wheel
95+
cd dist
96+
sha256sum * | tee SHA256SUMS
97+
98+
- name: Pack JavaScript package
99+
run: |
100+
yarn pack
101+
mv bqplot*.tgz ../dist
102+
103+
- name: Upload builds
104+
uses: actions/upload-artifact@v2
105+
with:
106+
name: dist ${{ github.run_number }}
107+
path: ./dist
108+
109+
# visual-regression-tests:
110+
# runs-on: ubuntu-latest
111+
# needs: [build]
112+
113+
# steps:
114+
# - name: Checkout
115+
# uses: actions/checkout@v2
116+
117+
# - name: Setup conda
118+
# uses: conda-incubator/setup-miniconda@v2
119+
# with:
120+
# activate-environment: bqplot-test
121+
# environment-file: test-environment.yml
122+
# python-version: 3.9
123+
# mamba-version: "*"
124+
# auto-activate-base: false
125+
# channels: conda-forge
126+
127+
# - uses: actions/download-artifact@v2
128+
# with:
129+
# name: dist ${{ github.run_number }}
130+
# path: ./dist
131+
132+
# - name: Install the package
133+
# run: pip install -vv bqplot*.whl
134+
# working-directory: dist
135+
136+
# - name: Install Galata
137+
# run: yarn install
138+
# working-directory: ui-tests
139+
140+
# - name: Launch JupyterLab
141+
# run: yarn run start-jlab:detached
142+
# working-directory: ui-tests
143+
144+
# - name: Wait for JupyterLab
145+
# uses: ifaxity/wait-on-action@v1
146+
# with:
147+
# resource: http-get://localhost:8888/api
148+
# timeout: 20000
149+
150+
# - name: Run UI Tests
151+
# run: yarn run test
152+
# working-directory: ui-tests
153+
154+
# - name: Upload UI Test artifacts
155+
# if: always()
156+
# uses: actions/upload-artifact@v2
157+
# with:
158+
# name: ui-test-output
159+
# path: ui-tests/test-output
160+
161+
install:
162+
runs-on: ${{ matrix.os }}-latest
163+
needs: [build]
164+
165+
strategy:
166+
fail-fast: false
167+
matrix:
168+
os: [ubuntu, macos, windows]
169+
python: ['3.9']
170+
171+
steps:
172+
173+
- name: Checkout
174+
uses: actions/checkout@v2
175+
176+
- name: Setup conda
177+
uses: conda-incubator/setup-miniconda@v2
178+
with:
179+
activate-environment: bqplot-gl-test
180+
environment-file: test-environment.yml
181+
python-version: ${{ matrix.python-version }}
182+
mamba-version: "*"
183+
auto-activate-base: false
184+
channels: conda-forge
185+
186+
- uses: actions/download-artifact@v2
187+
with:
188+
name: dist ${{ github.run_number }}
189+
path: ./dist
190+
191+
- name: Install the package
192+
run: |
193+
cd dist
194+
pip install -vv bqplot*.whl
195+
196+
- name: Test installation files
197+
run: |
198+
test -d $CONDA_PREFIX/share/jupyter/nbextensions/bqplot-gl
199+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot-gl/extension.js
200+
test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot-gl/index.js
201+
test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot-gl
202+
test -f $CONDA_PREFIX/share/jupyter/labextensions/bqplot-gl/package.json
203+
test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot-gl/static
204+
205+
- name: Validate the nbextension
206+
run: jupyter nbextension list 2>&1 | grep "bqplot-gl/extension"
207+
208+
- name: Validate the labextension
209+
run: jupyter labextension list 2>&1 | grep bqplot-gl

bqplot_gl/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Copyright (c) The bqplot Development Team.
55
# Distributed under the terms of the Modified BSD License.
66

7-
from .figure import FigureGL
8-
from .marks import *
9-
from ._version import __version__, version_info
7+
from .figure import FigureGL # noqa
8+
from .marks import * # noqa
9+
from ._version import __version__, version_info # noqa
1010

1111

1212
def _jupyter_labextension_paths():

test-environment.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: bqplot-gl-test
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- pip
6+
- python
7+
- yarn
8+
- ipywidgets >=5.2.2
9+
- traitlets >=4.3.0
10+
- traittypes >=0.0.6
11+
- numpy >=1.10.4,<2.0.0
12+
- pandas >=1.0.0,<2.0.0
13+
- bqscales >=0.2.2,<0.3
14+
- scipy
15+
- jupyter
16+
- jupyterlab=3.0.11 # to build the lab federated bundle
17+
- jupyter-packaging # to build the wheel
18+
- pytest
19+
- nbval
20+
- pytest-cov
21+
- selenium
22+
- flake8
23+
- nose

0 commit comments

Comments
 (0)