-
Notifications
You must be signed in to change notification settings - Fork 2
326 lines (295 loc) · 10.2 KB
/
Copy pathci.yml
File metadata and controls
326 lines (295 loc) · 10.2 KB
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
name: CI
on:
push:
tags:
- 'v[0-9]*.[0-9]*.[0-9]*'
- 'v[0-9]*.[0-9]*.[0-9]*a[0-9]*'
- 'v[0-9]*.[0-9]*.[0-9]*b[0-9]*'
- 'v[0-9]*.[0-9]*.[0-9]*rc[0-9]*'
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "9 16 * * 1"
jobs:
build:
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
cfg:
- label: Py-min
python-version: "3.10"
runs-on: ubuntu-latest
pytest: "-m 'not addon'"
- label: Py-max
python-version: "3.13"
runs-on: ubuntu-latest
pytest: "-k '(not (he4 and (3b or 4b) and not sio)) or supersys'"
- label: Py-314
python-version: "3.14"
runs-on: ubuntu-latest
pytest: "-k '(not (he4 and (3b or 4b) and not sio)) or supersys'"
- label: Demo
python-version: "3.11"
runs-on: ubuntu-latest
pytest: "-k 'examples or (121-nwchem_psi4 and 4b)'"
- label: QCSk-next
python-version: "3.12"
runs-on: ubuntu-latest
pytest: "-k '((not (he4 and (3b or 4b) and not sio)) or supersys) and not vmfc'"
name: "🐍 ${{ matrix.cfg.python-version }} • ${{ matrix.cfg.label }} • ${{ matrix.cfg.runs-on }}"
runs-on: ${{ matrix.cfg.runs-on }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Write a Conda Env File
run: |
cat > export.yaml <<EOF
name: test
channels:
- conda-forge
- conda-forge/label/qcelemental_dev
- conda-forge/label/qcengine_dev
dependencies:
# Build
- setuptools
- setuptools-scm
# Core
- python
- qcelemental >=0.50.0rc2
- qcengine >=0.50rc1 # TODO temp
- pydantic
# Testing
- pytest
- zstandard
- pytest-cov
- codecov
# Testing CMS
#- dummy1
#- dummy2
#- dummy3
#- nwchem # lands on different he4 soln
EOF
if [[ "${{ matrix.cfg.label }}" == "Py-min" ]]; then
:
#sed -i "s;pydantic;pydantic=1;g" export.yaml
fi
if [[ "${{ matrix.cfg.label }}" == "Py-max" ]]; then
sed -i "s;#- dummy1;- psi4;g" export.yaml
fi
if [[ "${{ matrix.cfg.label }}" == "Demo" ]]; then
:
sed -i "s;#- dummy1;- psi4=1.9.1;g" export.yaml
sed -i "s;#- dummy3;- libint=2.9.0=*_4;g" export.yaml
sed -i "s;#- dummy2;- nwchem;g" export.yaml
fi
if [[ "${{ matrix.cfg.label }}" == "QCSk-next" ]]; then
sed -i "s;pydantic;pydantic=2;g" export.yaml
sed -i "s;#- dummy1;- psi4;g" export.yaml
sed -i "s;#- dummy2;- pydantic-settings;g" export.yaml
fi
if [[ "${{ matrix.cfg.label }}" == "Py-314" ]]; then
sed -i "s;#- nwchem;- nwchem;g" export.yaml
sed -i "s;#- dummy1;- msgpack-python;g" export.yaml
sed -i "s;#- dummy2;- networkx;g" export.yaml
fi
# model sed for L/W
# sed -i "s;;;g" export.yaml
# model sed for M
# sed -E -i.bak "s;;;g" export.yaml
cat export.yaml
- name: Create Environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
environment-file: export.yaml
python-version: ${{ matrix.cfg.python-version }}
auto-activate-base: false
show-channel-urls: true
add-pip-as-python-dependency: true
channels: conda-forge
conda-remove-defaults: true
- name: Special Config - QCElemental Dep
if: false
run: |
conda remove qcelemental --force
python -m pip install 'git+https://github.com/MolSSI/QCElemental.git@loriab-patch-2' --no-deps
- name: Special Config - QCEngine Dep
if: false
#if: "(startsWith(matrix.cfg.label, 'Psi4')) || (matrix.cfg.label == 'ADCC') || (matrix.cfg.label == 'optimization-dispersion')"
run: |
conda remove qcengine --force
- name: Special Config - QCSchema Next Deps
if: "(startsWith(matrix.cfg.label, 'QCSk-next'))"
run: |
conda remove qcelemental qcengine --force
python -m pip install 'git+https://github.com/MolSSI/QCElemental.git@next2026' --no-deps
python -m pip install 'git+https://github.com/MolSSI/QCEngine.git@next2026' --no-deps
- name: Environment Information
run: |
conda info
conda list
- name: Install QCManyBody
run: |
pip install -e .
# python -m pip install . --no-deps # gives no codecov beyond tests
- name: Configure QCEngine
if: "(matrix.cfg.label != 'Py-min')"
run: |
cat > qcengine.yaml <<EOF
all:
hostname_pattern: "*"
memory: 2
ncores: 2
EOF
cat qcengine.yaml
qcengine info
- name: PyTest
run: |
pytest -rws -v ${{ matrix.cfg.pytest }} \
--cov=qcmanybody --cov-report=xml \
--color=yes --durations 50 --durations-min 20
- name: CodeCov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: loriab/QCManyBody
release_docs:
needs: [build]
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
cfg:
- label: Sphinx
python-version: "3.10"
runs-on: ubuntu-latest
name: "🐍 ${{ matrix.cfg.python-version }} • ${{ matrix.cfg.label }}"
runs-on: ${{ matrix.cfg.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Write a Conda Env File
run: |
cat > export.yaml <<EOF
name: test
channels:
- conda-forge
- conda-forge/label/qcelemental_dev
- conda-forge/label/qcengine_dev
dependencies:
# Build
- setuptools
- setuptools-scm
# Core
- python
- qcelemental >=0.50.0rc2
# Docs
- numpydoc
- docutils
- sphinx >=7.0.0
- sphinxcontrib-napoleon
- sphinx-rtd-theme
- autodoc-pydantic >=2
- sphinx-automodapi
- sphinx-autodoc-typehints
- pydantic >=2
EOF
cat export.yaml
- name: Create Environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
environment-file: export.yaml
python-version: ${{ matrix.cfg.python-version }}
auto-activate-base: false
show-channel-urls: true
add-pip-as-python-dependency: true
channels: conda-forge
conda-remove-defaults: true
- name: Environment Information
run: |
conda info
conda list --show-channel-urls
- name: Build Documentation
run: |
python -m pip install . --no-deps
QCMANYBODY_MAX_NBODY=5 sphinx-build docs/ build/docs
- name: Compute docs deploy target
id: target
shell: bash
run: |
set -euo pipefail
echo GITHUB_REF_TYPE ${GITHUB_REF_TYPE}
echo GITHUB_REF_NAME ${GITHUB_REF_NAME}
echo GITHUB_REF ${GITHUB_REF}
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
echo "target_folder=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
echo "version_label=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "target_folder=dev" >> "$GITHUB_OUTPUT"
echo "version_label=dev" >> "$GITHUB_OUTPUT"
else
echo "target_folder=" >> "$GITHUB_OUTPUT"
echo "version_label=" >> "$GITHUB_OUTPUT"
fi
echo GITHUB_OUTPUT ${GITHUB_OUTPUT}
- name: GitHub Pages Deploy
uses: JamesIves/github-pages-deploy-action@v4
if: github.event_name == 'push' && github.repository == 'MolSSI/QCManyBody' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/main' )
with:
branch: gh-pages
folder: build/docs/
target-folder: ${{ steps.target.outputs.target_folder }}
clean: false
- name: Update versions.json
if: github.event_name == 'push' && github.repository == 'MolSSI/QCManyBody' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/main' )
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_LABEL: ${{ steps.target.outputs.version_label }}
TARGET_FOLDER: ${{ steps.target.outputs.target_folder }}
run: |
set -euo pipefail
rm -rf _ghp
git clone --depth 1 --branch gh-pages "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" _ghp
cd _ghp
# Create versions.json if it doesn't exist yet
if [[ ! -f versions.json ]]; then
cat > versions.json <<'JSON'
[
{"label": "dev", "path": "dev/"},
{"label": "v0.5.1", "path": "v0.5.1"},
{"label": "v0.5.2", "path": "v0.5.2/"}
]
JSON
fi
python - <<'PY'
import json, pathlib, os
p = pathlib.Path("versions.json")
data = json.loads(p.read_text())
pinned = [
{"label": "dev", "path": "dev/"},
{"label": "v0.5.1", "path": "v0.5.1/"},
{"label": "v0.5.2", "path": "v0.5.2/"},
]
lbl = os.environ.get("VERSION_LABEL", "")
tgt = os.environ.get("TARGET_FOLDER", "")
if lbl and lbl not in ("dev",) and tgt:
pinned.insert(1, {"label": lbl, "path": tgt.rstrip("/") + "/"})
p.write_text(json.dumps(pinned, indent=2) + "\n")
PY
if ! git diff --quiet; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add versions.json
git commit -m "docs: update versions.json (${GITHUB_REF})"
git push origin gh-pages
fi