-
Notifications
You must be signed in to change notification settings - Fork 1
189 lines (168 loc) · 4.9 KB
/
ci.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
name: CI
on:
push:
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.8"
runs-on: ubuntu-latest
pytest: ""
- label: Py-max
python-version: "3.12"
runs-on: ubuntu-latest
pytest: "-k 'not (he4 and 4b)'"
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
- nodefaults
dependencies:
# Build
- setuptools
- setuptools-scm
# Core
- python
- qcengine
- pydantic
# Testing
- pytest
- zstandard
- pytest-cov
- codecov
# Testing CMS
- psi4
#- nwchem # lands on different he4 soln
#- networkx
EOF
if [[ "${{ runner.os }}" == "Linux" ]]; then
:
if [[ "${{ matrix.cfg.label }}" == "Py-min" ]]; then
sed -i "s;pydantic;pydantic=1;g" export.yaml
sed -i "s;- psi4;#- psi4;g" export.yaml
sed -i "s;- nwchem;#- nwchem;g" export.yaml
sed -i "s;- networkx;#- networkx;g" export.yaml
fi
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,nodefaults
- 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: Environment Information
run: |
conda info
conda list
- name: Install QCManyBody
run: |
python -m pip install . --no-deps
- name: PyTest
run: |
pytest -rws -v ${{ matrix.cfg.pytest }} --color=yes \
--cov=qcmanybody --cov-report=xml \
--durations 50 --durations-min 5
- name: CodeCov
uses: codecov/codecov-action@v3
release_docs:
needs: [build]
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
cfg:
- label: MkDocs
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
- nodefaults
dependencies:
# Build
- setuptools
- setuptools-scm
# Core
- python
- qcengine
- pydantic
# Docs
- mkdocs
- mkdocs-material
- mkdocstrings-python
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,nodefaults
- name: Environment Information
run: |
conda info
conda list --show-channel-urls
- name: Build Documentation
run: |
python -m pip install . --no-deps
mkdocs build
cd docs
- name: GitHub Pages Deploy
uses: JamesIves/[email protected]
if: github.event_name == 'push' && github.repository == 'MolSSI/QCManyBody' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/main' )
with:
branch: gh-pages
folder: site