@@ -19,42 +19,30 @@ concurrency:
19
19
jobs :
20
20
tests :
21
21
name : ${{ matrix.label }}
22
- runs-on : ${{ matrix.os }}
22
+ runs-on : ubuntu-latest
23
23
strategy :
24
24
matrix :
25
25
include :
26
- - label : CI-old
27
- os : ubuntu-latest
26
+ - label : rdkit-2021
28
27
python-version : 3.8
29
- extra_dependencies : " rdkit==2020.03.1 boost-cpp=1.72.0=h359cf19_6"
30
- - label : CI-edge
31
- os : ubuntu-latest
28
+ extra_dependencies : " rdkit==2021.03.1"
29
+ - label : rdkit-latest
32
30
python-version : " 3.10"
33
31
extra_dependencies : " rdkit"
34
- - label : CI-py3.9-rdkit2022
35
- os : ubuntu-latest
36
- python-version : 3.9
37
- extra_dependencies : " rdkit==2022.03.1"
38
32
39
33
steps :
40
34
- uses : actions/checkout@v3
41
35
42
- - name : Install node
43
- uses : actions/setup-node@v3
44
- with :
45
- node-version : 18
46
- cache : " yarn"
47
-
48
36
- name : Install Firefox
49
37
uses : browser-actions/setup-firefox@latest
50
-
38
+
51
39
- run : firefox --version
52
40
53
41
- name : Prepare Selenium
54
42
uses : browser-actions/setup-geckodriver@latest
55
43
with :
56
44
geckodriver-version : " 0.32.0"
57
-
45
+
58
46
- run : geckodriver --version
59
47
60
48
- name : Cache conda
@@ -64,15 +52,27 @@ jobs:
64
52
with :
65
53
path : ~/conda_pkgs_dir
66
54
key :
67
- conda-${{ hashFiles('environment.yml') }}-${{ matrix.label }}-${{ env.CACHE_NUMBER }}
55
+ conda-${{ hashFiles('tests/ environment.yml') }}-${{ matrix.label }}-${{ env.CACHE_NUMBER }}
68
56
69
57
- name : Cache pip
70
58
uses : actions/cache@v3
71
59
with :
72
60
path : ~/.cache/pip
73
- key : pip-${{ hashFiles('setup.cfg ') }}
61
+ key : pip-${{ hashFiles('pyproject.toml ') }}
74
62
restore-keys : pip-
75
63
64
+ - name : Get yarn cache directory path
65
+ id : yarn-cache-dir-path
66
+ run : echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
67
+
68
+ - name : Cache yarn
69
+ uses : actions/cache@v3
70
+ with :
71
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
72
+ key : yarn-${{ hashFiles('yarn.lock') }}
73
+ restore-keys : |
74
+ yarn-
75
+
76
76
- name : Setup Conda
77
77
uses : conda-incubator/setup-miniconda@v2
78
78
with :
@@ -93,14 +93,16 @@ jobs:
93
93
94
94
- name : Install remaining conda dependencies
95
95
run : |
96
- mamba install ${{ matrix.extra_dependencies }}
96
+ mamba install 'jupyterlab>=3,<5' ipywidgets=8 ${{ matrix.extra_dependencies }}
97
97
mamba list
98
98
99
- - name : Install package through pip
99
+ - name : Build and install package
100
100
run : |
101
101
pip install .[tests,build]
102
+ jupyter labextension develop . --overwrite
102
103
pip list
103
-
104
+ jupyter labextension list
105
+
104
106
- name : Run tests
105
107
run : |
106
108
pytest --color=yes --disable-pytest-warnings \
@@ -120,26 +122,147 @@ jobs:
120
122
fail_ci_if_error : true
121
123
verbose : true
122
124
123
- - name : Prepare for build
124
- run : |
125
- pip uninstall -y mols2grid
126
- python -m build .
127
- echo "$SCRIPT" > test_install.py
128
- cat test_install.py
125
+ build :
126
+ name : Build package
127
+ runs-on : ubuntu-latest
128
+ steps :
129
+ - name : Build package
130
+ uses : ./.github/workflows/_build-package.yml
131
+
132
+ - name : Prepare quick test script
133
+ run : |
134
+ echo "$SCRIPT" > test_install.py
135
+ cat test_install.py
136
+ env :
137
+ SCRIPT : |
138
+ import mols2grid as mg
139
+ from rdkit import RDConfig
140
+ sdf = f"{RDConfig.RDDocsDir}/Book/data/solubility.test.sdf"
141
+ mg.save(sdf, output="/dev/null")
142
+
143
+ - name : Test tar.gz build
144
+ run : |
145
+ pip install dist/mols2grid-*.tar.gz
146
+ python test_install.py
147
+ pip uninstall -y mols2grid
148
+
149
+ - name : Test wheel build
150
+ run : |
151
+ pip install dist/mols2grid-*.whl
152
+ python test_install.py
153
+
154
+ - name : Cache package
155
+ uses : actions/cache@v3
156
+ id : cache-mols2grid
157
+ with :
158
+ path : dist/mols2grid-*.whl
159
+ key : ${{ runner.os }}-mols2grid-wheel
160
+
161
+ notebook-tests :
162
+ needs : [build]
163
+ name : ${{ matrix.label }}
164
+ runs-on : ubuntu-latest
165
+ strategy :
166
+ matrix :
167
+ include :
168
+ - label : JLab-3-Widgets-7
169
+ extra_dependencies : " jupyterlab>=3.2 ipywidgets=7"
170
+ - label : JLab-4-Widgets-8
171
+ extra_dependencies : " jupyterlab=4 ipywidgets=8"
172
+
173
+ steps :
174
+ - uses : actions/checkout@v3
175
+
176
+ - name : Retrieve cached package
177
+ uses : actions/cache@v3
178
+ id : cache-mols2grid
179
+ with :
180
+ path : dist/mols2grid-*.whl
181
+ key : ${{ runner.os }}-mols2grid-wheel
182
+
183
+ - name : Cache conda
184
+ uses : actions/cache@v3
129
185
env :
130
- SCRIPT : |
131
- import mols2grid as mg
132
- from rdkit import RDConfig
133
- sdf = f"{RDConfig.RDDocsDir}/Book/data/solubility.test.sdf"
134
- mg.save(sdf, output="/dev/null")
186
+ CACHE_NUMBER : 0
187
+ with :
188
+ path : ~/conda_pkgs_dir
189
+ key :
190
+ conda-${{ hashFiles('tests/environment.yml') }}-${{ matrix.label }}-${{ env.CACHE_NUMBER }}
135
191
136
- - name : Test tar.gz build
192
+ - name : Cache pip
193
+ uses : actions/cache@v3
194
+ with :
195
+ path : ~/.cache/pip
196
+ key : pip-${{ hashFiles('pyproject.toml') }}
197
+ restore-keys : pip-
198
+
199
+ - name : Get yarn cache directory path
200
+ id : yarn-ui-cache-dir-path
201
+ run : echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
202
+
203
+ - name : Cache yarn
204
+ uses : actions/cache@v3
205
+ with :
206
+ path : ${{ steps.yarn-ui-cache-dir-path.outputs.dir }}
207
+ key : yarn-ui-${{ hashFiles('tests/notebooks/yarn.lock') }}
208
+ restore-keys : |
209
+ yarn-ui-
210
+
211
+ - name : Setup Conda
212
+ uses : conda-incubator/setup-miniconda@v2
213
+ with :
214
+ python-version : " 3.10"
215
+ use-only-tar-bz2 : true
216
+ miniforge-variant : Mambaforge
217
+ miniforge-version : latest
218
+ use-mamba : true
219
+
220
+ - name : Install remaining conda dependencies
221
+ run : |
222
+ mamba install rdkit pandas ${{ matrix.extra_dependencies }}
223
+ mamba list
224
+
225
+ - name : Install the extension
226
+ run : |
227
+ pip install dist/mols2grid-*.whl[packaging]
228
+ jupyter labextension list
229
+
230
+ - name : Install Test Dependencies
137
231
run : |
138
- pip install dist/mols2grid-*.tar.gz
139
- python test_install.py
140
- pip uninstall -y mols2grid
232
+ jlpm --no-immutable
233
+ npx playwright install chromium
234
+ working-directory : tests/notebooks
141
235
142
- - name : Test wheel build
236
+ - name : Execute integration tests
237
+ working-directory : tests/notebooks
143
238
run : |
144
- pip install dist/mols2grid-*.whl
145
- python test_install.py
239
+ npx playwright test
240
+
241
+ - name : Upload Playwright Test assets
242
+ if : always()
243
+ uses : actions/upload-artifact@v3
244
+ with :
245
+ name : notebooks-test-assets
246
+ path : |
247
+ tests/notebooks/test-results
248
+
249
+ - name : Upload Playwright Test report
250
+ if : always()
251
+ uses : actions/upload-artifact@v3
252
+ with :
253
+ name : notebooks-test-report
254
+ path : |
255
+ tests/notebooks/playwright-report
256
+
257
+ - name : Update snapshots
258
+ if : failure()
259
+ working-directory : tests/notebooks
260
+ run : |
261
+ jlpm test:update
262
+
263
+ - name : Upload updated snapshots
264
+ if : failure()
265
+ uses : actions/upload-artifact@v3
266
+ with :
267
+ name : notebook-updated-snapshots
268
+ path : tests/notebooks/tests
0 commit comments