-
Notifications
You must be signed in to change notification settings - Fork 2
253 lines (208 loc) · 6.81 KB
/
gh-ci.yaml
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
name: GH Actions CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# weekly tests, Sundays at midnight
- cron: "0 0 * * 0"
concurrency:
# Specific group naming so CI is only cancelled
# within same PR or on merge to main
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
jobs:
main_tests:
name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
pydantic-version: ["1", "2"]
include-rdkit: [true, false]
include-openeye: [true, false]
include-dgl: [true, false]
exclude:
- include-rdkit: false
include-openeye: false
# broken OpenMM build for Mac on 3.10
- os: "macOS-latest"
python-version: "3.10"
# no dgl for 3.12 yet
- include-dgl: true
python-version: "3.12"
# no openeye for 3.12 yet
- include-openeye: true
python-version: "3.12"
steps:
- uses: actions/checkout@v3
- name: Build information
run: |
uname -a
df -h
ulimit -a
- name: Install environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test_env_dgl_${{ matrix.include-dgl }}.yaml
create-args: >-
python=${{ matrix.python-version }}
pydantic=${{ matrix.pydantic-version }}
- name: Install package
run: |
python -m pip install . --no-deps
- name: Python information
run: |
which python
conda info
conda list
- uses: ./.github/actions/include-openeye
if: matrix.include-openeye == true
with:
openeye-license-text: ${{ secrets.OE_LICENSE }}
openeye-license-file: ${{ env.OE_LICENSE }}
- name: Uninstall OpenEye
if: matrix.include-openeye == false
run: conda remove --force openeye --yes || echo "openeye not installed"
- name: Uninstall RDKit
if: matrix.include-rdkit == false
run: conda remove --force rdkit --yes || echo "rdkit not installed"
- name: Check toolkit installations
shell: bash -l -c "python -u {0}"
run: |
from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE
assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}'
assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}'
- name: Run tests
run: |
python -m pytest -n 4 -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/
- name: codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
verbose: True
# name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
nightly_check:
name: Nightly check
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
exclude:
# mdtraj currently doesn't support MacOS py3.12
- os: "macOS-latest"
python-version: "3.12"
steps:
- uses: actions/checkout@v3
- name: Build information
run: |
uname -a
df -h
ulimit -a
- name: Install environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/nightly.yaml
create-args: >-
python=${{ matrix.python-version }}
pydantic=2
- name: Install nightly pytorch-lightning and DGL
run: |
python -m pip install --pre dgl -f https://data.dgl.ai/wheels-test/repo.html
python -m pip install --pre dglgo -f https://data.dgl.ai/wheels-test/repo.html
python -m pip install https://github.com/Lightning-AI/lightning/archive/refs/heads/master.zip -U
- name: Install package
run: |
python -m pip install . --no-deps
- name: Python information
run: |
which python
conda info
conda list
- name: Run tests
run: |
python -m pytest -n 4 -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/
pylint_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Pylint
run: |
which pip
which python
pip install pylint
- name: Run Pylint
env:
PYLINTRC: .pylintrc
run: |
pylint openff-nagl
pypi_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install setuptools twine
- name: Build package
run: |
python setup.py sdist
- name: Check package build
run: |
DISTRIBUTION=$(ls -t1 dist/openff-nagl-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution dist/openff-nagl-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION
install_from_source_conda:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Install conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
add-pip-as-python-dependency: true
architecture: x64
miniforge-variant: Mambaforge
use-mamba: true
auto-update-conda: true
show-channel-urls: true
channels: conda-forge, defaults
- name: Build from source
run: |
conda create --name openff-nagl
conda activate openff-nagl
conda list
mamba env update --name openff-nagl --file devtools/conda-envs/test_env_dgl_false.yaml
mamba env update --name openff-nagl --file devtools/conda-envs/docs_env.yaml
python --version
python -m pip install . --no-deps
conda list
- name: Check success
run: |
conda activate openff-nagl
python -c "import openff.nagl ; print(openff.nagl.__version__)"