@@ -17,117 +17,118 @@ concurrency:
17
17
# cancel-in-progress: true
18
18
19
19
jobs :
20
- tests :
21
- name : ${{ matrix.label }}
22
- runs-on : ubuntu-latest
23
- strategy :
24
- matrix :
25
- include :
26
- - label : rdkit-2021
27
- python-version : 3.8
28
- extra_dependencies : " rdkit==2021.03.1"
29
- - label : rdkit-latest
30
- python-version : " 3.10"
31
- extra_dependencies : " rdkit"
20
+ # unit- tests:
21
+ # name: ${{ matrix.label }}
22
+ # runs-on: ubuntu-latest
23
+ # strategy:
24
+ # matrix:
25
+ # include:
26
+ # - label: rdkit-2021
27
+ # python-version: 3.8
28
+ # extra_dependencies: "rdkit==2021.03.1"
29
+ # - label: rdkit-latest
30
+ # python-version: "3.10"
31
+ # extra_dependencies: "rdkit"
32
32
33
- steps :
34
- - uses : actions/checkout@v3
33
+ # steps:
34
+ # - uses: actions/checkout@v3
35
35
36
- - name : Install Firefox
37
- uses : browser-actions/setup-firefox@latest
36
+ # - name: Install Firefox
37
+ # uses: browser-actions/setup-firefox@latest
38
38
39
- - run : firefox --version
39
+ # - run: firefox --version
40
40
41
- - name : Prepare Selenium
42
- uses : browser-actions/setup-geckodriver@latest
43
- with :
44
- geckodriver-version : " 0.32.0"
41
+ # - name: Prepare Selenium
42
+ # uses: browser-actions/setup-geckodriver@latest
43
+ # with:
44
+ # geckodriver-version: "0.32.0"
45
45
46
- - run : geckodriver --version
46
+ # - run: geckodriver --version
47
47
48
- - name : Cache conda
49
- uses : actions/cache@v3
50
- env :
51
- CACHE_NUMBER : 0
52
- with :
53
- path : ~/conda_pkgs_dir
54
- key :
55
- conda-${{ hashFiles('tests/environment.yml') }}-${{ matrix.label }}-${{ env.CACHE_NUMBER }}
48
+ # - name: Cache conda
49
+ # uses: actions/cache@v3
50
+ # env:
51
+ # CACHE_NUMBER: 0
52
+ # with:
53
+ # path: ~/conda_pkgs_dir
54
+ # key:
55
+ # conda-${{ hashFiles('tests/environment.yml') }}-${{ matrix.label }}-${{ env.CACHE_NUMBER }}
56
56
57
- - name : Cache pip
58
- uses : actions/cache@v3
59
- with :
60
- path : ~/.cache/pip
61
- key : pip-${{ hashFiles('pyproject.toml') }}
62
- restore-keys : pip-
57
+ # - name: Cache pip
58
+ # uses: actions/cache@v3
59
+ # with:
60
+ # path: ~/.cache/pip
61
+ # key: pip-${{ hashFiles('pyproject.toml') }}
62
+ # restore-keys: pip-
63
63
64
- - name : Get yarn cache directory path
65
- id : yarn-cache-dir-path
66
- run : echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
64
+ # - name: Get yarn cache directory path
65
+ # id: yarn-cache-dir-path
66
+ # run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
67
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-
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
75
76
- - name : Setup Conda
77
- uses : conda-incubator/setup-miniconda@v2
78
- with :
79
- python-version : ${{ matrix.python-version }}
80
- environment-file : tests/environment.yml
81
- use-only-tar-bz2 : true
82
- miniforge-variant : Mambaforge
83
- miniforge-version : latest
84
- use-mamba : true
76
+ # - name: Setup Conda
77
+ # uses: conda-incubator/setup-miniconda@v2
78
+ # with:
79
+ # python-version: ${{ matrix.python-version }}
80
+ # environment-file: tests/environment.yml
81
+ # use-only-tar-bz2: true
82
+ # miniforge-variant: Mambaforge
83
+ # miniforge-version: latest
84
+ # use-mamba: true
85
85
86
- - name : Check conda and pip
87
- run : |
88
- which python
89
- python --version
90
- pip --version
91
- conda --version
92
- mamba --version
86
+ # - name: Check conda and pip
87
+ # run: |
88
+ # which python
89
+ # python --version
90
+ # pip --version
91
+ # conda --version
92
+ # mamba --version
93
93
94
- - name : Install remaining conda dependencies
95
- run : |
96
- mamba install 'jupyterlab>=3,<5' ipywidgets=8 ${{ matrix.extra_dependencies }}
97
- mamba list
94
+ # - name: Install remaining conda dependencies
95
+ # run: |
96
+ # mamba install 'jupyterlab>=3,<5' ipywidgets=8 ${{ matrix.extra_dependencies }}
97
+ # mamba list
98
98
99
- - name : Build and install package
100
- run : |
101
- pip install .[tests,build]
102
- jupyter labextension develop . --overwrite
103
- pip list
104
- jupyter labextension list
99
+ # - name: Build and install package
100
+ # run: |
101
+ # pip install .[tests,build]
102
+ # jupyter labextension develop . --overwrite
103
+ # pip list
104
+ # jupyter labextension list
105
105
106
- - name : Run tests
107
- run : |
108
- pytest --color=yes --disable-pytest-warnings \
109
- --cov=mols2grid --cov-report=xml \
110
- tests/ -m "not webdriver"
106
+ # - name: Run tests
107
+ # run: |
108
+ # pytest --color=yes --disable-pytest-warnings \
109
+ # --cov=mols2grid --cov-report=xml \
110
+ # tests/ -m "not webdriver"
111
111
112
- - name : Run webdriver tests
113
- run : |
114
- pytest --color=yes --disable-pytest-warnings \
115
- --cov=mols2grid --cov-report=xml --cov-append \
116
- tests/ -m "webdriver"
112
+ # - name: Run webdriver tests
113
+ # run: |
114
+ # pytest --color=yes --disable-pytest-warnings \
115
+ # --cov=mols2grid --cov-report=xml --cov-append \
116
+ # tests/ -m "webdriver"
117
117
118
- - name : Measure tests coverage
119
- uses : codecov/codecov-action@v3
120
- with :
121
- files : ./coverage.xml
122
- fail_ci_if_error : true
123
- verbose : true
118
+ # - name: Measure tests coverage
119
+ # uses: codecov/codecov-action@v3
120
+ # with:
121
+ # files: ./coverage.xml
122
+ # fail_ci_if_error: true
123
+ # verbose: true
124
124
125
125
build :
126
126
uses : ./.github/workflows/_build-package.yml
127
127
with :
128
128
cache-package : true
129
+ upload-package : true
129
130
130
- test- build :
131
+ build-test :
131
132
name : Test build
132
133
needs : [build]
133
134
runs-on : ubuntu-latest
@@ -170,61 +171,100 @@ jobs:
170
171
pip install dist/mols2grid-*.whl \
171
172
&& python test_install.py
172
173
173
- # notebook-tests:
174
- # needs: [build]
175
- # name: ${{ matrix.label }}
176
- # runs-on: ubuntu-latest
177
- # strategy:
178
- # matrix:
179
- # include:
180
- # - label: JLab-3-Widgets-7
181
- # extra_dependencies: "'jupyterlab~=3.2' 'ipywidgets~=7.6'"
182
- # - label: JLab-4-Widgets-8
183
- # extra_dependencies: "'jupyterlab~=4.0' 'ipywidgets~=8.1'"
184
-
185
- # steps:
186
- # - uses: actions/checkout@v3
187
-
188
- # - name: Retrieve cached package
189
- # uses: actions/cache/restore@v3
190
- # id: cache-mols2grid
191
- # with:
192
- # path: |
193
- # dist/mols2grid-*.whl
194
- # dist/mols2grid-*.tar.gz
195
- # key: mols2grid-${{ runner.os }}-${{ github.sha }}
174
+ ui-tests :
175
+ needs : [build]
176
+ name : ${{ matrix.label }}
177
+ runs-on : ubuntu-latest
178
+ strategy :
179
+ matrix :
180
+ include :
181
+ - label : JLab-3-Widgets-7
182
+ extra_dependencies : " 'jupyterlab~=3.2' 'ipywidgets~=7.6'"
183
+ - label : JLab-4-Widgets-8
184
+ extra_dependencies : " 'jupyterlab~=4.0' 'ipywidgets~=8.1'"
196
185
197
- # - name: Cache conda
198
- # uses: actions/cache@v3
199
- # env:
200
- # CACHE_NUMBER: 2
201
- # with:
202
- # path: ~/conda_pkgs_dir
203
- # key:
204
- # conda-${{ matrix.label }}-${{ env.CACHE_NUMBER }}
186
+ steps :
187
+ - uses : actions/checkout@v3
205
188
206
- # - name: Setup Conda
207
- # uses: conda-incubator/setup-miniconda@v2
208
- # with:
209
- # python-version: "3.10"
210
- # miniforge-variant: Mambaforge
211
- # miniforge-version: latest
212
- # use-mamba: true
189
+ - name : Retrieve cached package
190
+ uses : actions/cache/restore@v3
191
+ id : cache-mols2grid
192
+ with :
193
+ path : |
194
+ dist/mols2grid-*.whl
195
+ dist/mols2grid-*.tar.gz
196
+ key : mols2grid-${{ runner.os }}-${{ github.sha }}
213
197
214
- # - name: Install remaining conda dependencies
215
- # run: |
216
- # mamba install rdkit pandas ${{ matrix.extra_dependencies }}
217
- # mamba list
198
+ - name : Cache conda
199
+ uses : actions/cache@v3
200
+ env :
201
+ CACHE_NUMBER : 2
202
+ with :
203
+ path : ~/conda_pkgs_dir
204
+ key :
205
+ conda-${{ matrix.label }}-${{ env.CACHE_NUMBER }}
218
206
219
- # - name: Get wheel absolute path
220
- # id: wheel-path
221
- # run: echo "value=$(ls -d $PWD/dist/mols2grid-*.whl)" >> $GITHUB_OUTPUT
207
+ - name : Setup Conda
208
+ uses : conda-incubator/setup-miniconda@v2
209
+ with :
210
+ python-version : " 3.10"
211
+ miniforge-variant : Mambaforge
212
+ miniforge-version : latest
213
+ use-mamba : true
222
214
223
- # - name: Install the extension
224
- # run: |
225
- # pip install 'mols2grid[packaging] @ file://${{ steps.wheel-path.outputs.value }}'
226
- # jupyter labextension list
215
+ - name : Install remaining conda dependencies
216
+ run : |
217
+ mamba install \
218
+ rdkit pandas \
219
+ ${{ matrix.extra_dependencies }}
220
+ mamba install -c microsoft playwright
221
+ mamba list
222
+
223
+ - name : Install XeLatex
224
+ run : sudo apt-get install texlive-xetex
225
+
226
+ - name : Install Ghostscript for ImageMagick
227
+ run : sudo apt-get install ghostscript
228
+
229
+ - name : Install the extension
230
+ run : |
231
+ pip install dist/mols2grid-*.whl
232
+ jupyter labextension list
233
+
234
+ - name : Run test notebook and convert to PDF
235
+ working-directory : tests/notebooks/
236
+ run : |
237
+ jupyter nbconvert --execute --no-input \
238
+ --allow-chromium-download --to webpdf \
239
+ filtering.ipynb
240
+
241
+ - name : Change ImageMagick policy to allow pdf->png conversion
242
+ run : |
243
+ sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
244
+
245
+ - name : Convert to PNG
246
+ id : png-conv
247
+ working-directory : tests/notebooks/
248
+ run : |
249
+ mv filtering.pdf ${{ matrix.label }}.pdf
250
+ convert -density 192 ${{ matrix.label }}.pdf \
251
+ -quality 100 -alpha remove ${{ matrix.label }}.png
252
+ ls
253
+
254
+ - name : Run diff
255
+ id : diff-test
256
+ working-directory : tests/notebooks/
257
+ run : |
258
+ delta=$(compare -metric AE -fuzz 10% ref-${{ matrix.label }}.png ${{ matrix.label }}.png null:)
259
+ echo "Delta: $delta"
260
+ [[ $delta -eq 0 ]]
227
261
228
- # - name: Run test
229
- # run: |
230
- # echo TODO
262
+ - name : Upload output if fail
263
+ if : always()
264
+ uses : actions/upload-artifact@v4
265
+ with :
266
+ name : notebook-${{ matrix.label }}
267
+ path : |
268
+ tests/notebooks/${{ matrix.label }}*
269
+ if-no-files-found : error
270
+ retention-days : 5
0 commit comments