-
-
Notifications
You must be signed in to change notification settings - Fork 151
238 lines (211 loc) · 7.28 KB
/
tests_and_cleanup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: Ersilia tests, installation checks, and cleanup of model request template
on:
pull_request:
branches: [master]
push:
branches: [master]
workflow_dispatch:
jobs:
install-ersilia:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: ${{ matrix.python-version }}
- name: Install Ersilia
run: |
python -m pip install git+https://github.com/ersilia-os/bentoml-ersilia.git
python -m pip install -e .
- name: Test help command
run: |
ersilia --help
ersilia --version
test-docker:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: ${{ matrix.python-version }}
- name: Install Ersilia without pre-installing BentoML
run: |
python -m pip install -e .
- name: Test help command again
run: |
ersilia --help
ersilia --version
- name: Fetch molecular weight model from DockerHub
run: |
ersilia -v fetch molecular-weight --from_dockerhub
test-os:
strategy:
matrix:
platform: [ubuntu-22.04, macos-latest]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # [email protected]
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10.10"
- name: Install dependencies
run: |
conda install git-lfs -c conda-forge
git-lfs install
conda install gh -c conda-forge
- name: Install ersilia from source
run: |
python --version
python -m pip install -e .
- name: Ersilia help
run: |
ersilia --help
run-pytest:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # [email protected]
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10.10"
- name: Install dependencies
run: |
conda install git-lfs -c conda-forge
git-lfs install
conda install gh -c conda-forge
python -m pip install -e .[test]
- name: Run pytest
run: |
pip install pytest pytest-benchmark pytest-asyncio rdkit-pypi nox rich fuzzywuzzy scipy
pytest
run-cli-test-single:
needs: run-pytest
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
session:
- setup
- test_from_github
- test_from_dockerhub
- test_auto_fetcher_decider
- test_conventional_run
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # [email protected]
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10.10"
- name: Install dependencies
run: |
conda install git-lfs -c conda-forge
git-lfs install
conda install gh -c conda-forge
python -m pip install -e .[test]
- name: Run CLI Test Default
run: |
nox -f test/playground/noxfile.py -s ${{ matrix.session }}
run-cli-test-multiple:
needs: run-pytest
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # [email protected]
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10.10"
- name: Install dependencies
run: |
conda install git-lfs -c conda-forge
git-lfs install
conda install gh -c conda-forge
python -m pip install -e .[test]
- name: Run CLI Test Multiple
run: |
nox -f test/playground/noxfile.py -s setup test_fetch_multiple_models test_serve_multiple_models
test-colab-notebook:
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # [email protected]
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10.10"
- name: Install dependencies
run: |
conda install google-colab -c conda-forge
pip install --upgrade nbconvert nbformat jsonschema pandas jupyter
jupyter --version
- name: Test Google Colab Notebook with CLI shell commands
run: |
jupyter nbconvert --to notebook --execute notebooks/test-colab-notebook-cli.ipynb --output=output-cli.ipynb --ExecutePreprocessor.timeout=-1
- name: Test Google Colab Notebook with Python API commands
run: |
echo "Skipping Python API notebook due to unresolved issue"
#jupyter nbconvert --to notebook --execute notebooks/test-colab-notebook-python-api.ipynb --output=output-python-api.ipynb --ExecutePreprocessor.timeout=-1
- name: Upload Output of the Google Colab Notebook CLI
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # [email protected]
with:
name: output-cli.ipynb
path: notebooks/output-cli.ipynb
retention-days: 7
update-model-request_template:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Path Filter
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
tag-file:
- 'ersilia/hub/content/metadata/tag.txt'
- name: Set up Python
if: steps.filter.outputs.tag-file == 'true'
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
if: steps.filter.outputs.tag-file == 'true'
run: |
python -m pip install --upgrade pip
pip install pyyaml
- name: Run update_model_request_template.py
if: steps.filter.outputs.tag-file == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/scripts/update_model_request_template.py
- name: Commit and push changes
if: steps.filter.outputs.tag-file == 'true'
uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # [email protected]
with:
author_name: "ersilia-bot"
author_email: "[email protected]"
message: "Update model request template [skip ci]"
repository: "ersilia-os/ersilia"
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
branch: "master"