8
8
branches :
9
9
- master
10
10
11
+ defaults :
12
+ run :
13
+ shell : bash -l {0}
14
+
11
15
jobs :
12
16
run :
13
17
runs-on : ${{ matrix.os }}
14
18
15
19
strategy :
16
20
fail-fast : false
17
21
matrix :
18
- os : [ubuntu-latest, macos-latest ]
19
- python-version : [3.7, 3. 8]
22
+ os : [ubuntu-latest]
23
+ python-version : [3.8]
20
24
21
25
steps :
22
26
- name : Checkout
@@ -25,19 +29,17 @@ jobs:
25
29
- name : Setup conda
26
30
uses : conda-incubator/setup-miniconda@v2
27
31
with :
32
+ activate-environment : ipympl-dev
33
+ environment-file : dev-environment.yml
34
+ python-version : ${{ matrix.python-version }}
28
35
mamba-version : " *"
36
+ auto-activate-base : false
29
37
channels : conda-forge
30
38
31
- - name : Mamba install dependencies
32
- shell : bash -l {0}
33
- run : mamba install python=${{ matrix.python-version }} pip nodejs ipywidgets=7.6 jupyter jupyterlab=3 pillow numpy matplotlib flake8 pytest nbval
34
-
35
39
- name : Install ipympl
36
- shell : bash -l {0}
37
40
run : pip install -e .
38
41
39
42
- name : Check installation files
40
- shell : bash -l {0}
41
43
run : |
42
44
test -d $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib
43
45
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/extension.js
@@ -46,22 +48,109 @@ jobs:
46
48
test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/package.json
47
49
48
50
- name : Check nbextension and labextension
49
- shell : bash -l {0}
50
51
run : |
51
52
jupyter nbextension list 2>&1 | grep -ie "jupyter-matplotlib/extension.*enabled" -
52
53
jupyter labextension list 2>&1 | grep -ie "jupyter-matplotlib.*enabled.*ok" -
53
54
54
55
- name : Run tests
55
- shell : bash -l {0}
56
56
run : pytest .
57
57
58
58
- name : Test flake8
59
- shell : bash -l {0}
60
59
run : flake8 ipympl --ignore=E501,W504,W503
61
60
62
61
- name : Test JS linters
63
- shell : bash -l {0}
64
62
working-directory : js
65
63
run : |
66
64
npm run eslint:check
67
65
npm run prettier:check
66
+
67
+ build :
68
+ runs-on : ubuntu-latest
69
+ steps :
70
+
71
+ - name : Checkout
72
+ uses : actions/checkout@v2
73
+
74
+ - name : Setup conda
75
+ uses : conda-incubator/setup-miniconda@v2
76
+ with :
77
+ activate-environment : ipympl-dev
78
+ environment-file : dev-environment.yml
79
+ python-version : ${{ matrix.python-version }}
80
+ mamba-version : " *"
81
+ auto-activate-base : false
82
+ channels : conda-forge
83
+
84
+ - name : Build packages
85
+ run : |
86
+ python setup.py sdist bdist_wheel
87
+ cd dist
88
+ sha256sum * | tee SHA256SUMS
89
+
90
+ - name : Upload builds
91
+ uses : actions/upload-artifact@v2
92
+ with :
93
+ name : dist ${{ github.run_number }}
94
+ path : ./dist
95
+
96
+ install :
97
+ runs-on : ${{ matrix.os }}-latest
98
+ needs : [build]
99
+
100
+ strategy :
101
+ fail-fast : false
102
+ matrix :
103
+ os : [ubuntu, macos]
104
+ python : ['3.6', '3.9']
105
+ include :
106
+ - python : ' 3.6'
107
+ dist : ' ipympl*.tar.gz'
108
+ jlab_version : 3
109
+ - python : ' 3.9'
110
+ dist : ' ipympl*.whl'
111
+ jlab_version : 2
112
+
113
+ steps :
114
+
115
+ - name : Checkout
116
+ uses : actions/checkout@v2
117
+
118
+ - name : Setup conda
119
+ uses : conda-incubator/setup-miniconda@v2
120
+ with :
121
+ python-version : ${{ matrix.python-version }}
122
+ mamba-version : " *"
123
+ auto-activate-base : false
124
+ channels : conda-forge
125
+
126
+ - name : Install dependencies
127
+ run : mamba install python=${{ matrix.python-version }} pip yarn jupyterlab=${{ matrix.jlab_version }} ipywidgets jupyter-packaging
128
+
129
+ - uses : actions/download-artifact@v2
130
+ with :
131
+ name : dist ${{ github.run_number }}
132
+ path : ./dist
133
+
134
+ - name : Install the package
135
+ run : |
136
+ cd dist
137
+ pip install -vv ${{ matrix.dist }}
138
+
139
+ - name : Manually install labextension for lab2
140
+ if : ${{ matrix.jlab_version }} == 2
141
+ run : jupyter labextension install js
142
+
143
+ - name : Test installation files
144
+ run : |
145
+ test -d $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib
146
+ test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/extension.js
147
+ test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/index.js
148
+ test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib
149
+ test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/package.json
150
+ test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/static
151
+
152
+ - name : Validate the nbextension
153
+ run : jupyter nbextension list 2>&1 | grep "jupyter-matplotlib/extension"
154
+
155
+ - name : Validate the labextension
156
+ run : jupyter labextension list 2>&1 | grep jupyter-matplotlib
0 commit comments