-
Notifications
You must be signed in to change notification settings - Fork 11
210 lines (178 loc) · 5.36 KB
/
pythonapp.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
name: test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CP2K_DEFAULT: "2023.1"
TAG: "3.2.0" # The nlesc-nano/nano-qmflows-manylinux tag
PY_COLORS: "1"
jobs:
test_conda:
name: Test python ${{ matrix.version }} (conda) on ${{ matrix.os }}; ${{ matrix.special[0] }} ${{ matrix.special[1] }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
special:
- ["", ""]
include:
# GCC 7/11 tests
- os: ubuntu-20.04
version: "3.11"
special: ["GCC", "7"]
- os: ubuntu-latest
version: "3.11"
special: ["GCC", "12"]
# CP2K 6.1/7.1/8.2/9.1/2022.1 tests
- os: ubuntu-latest
version: "3.11"
special: ["CP2K", "6.1"]
- os: ubuntu-latest
version: "3.11"
special: ["CP2K", "7.1"]
- os: ubuntu-latest
version: "3.11"
special: ["CP2K", "8.2"]
- os: ubuntu-latest
version: "3.11"
special: ["CP2K", "9.1"]
- os: ubuntu-latest
version: "3.11"
special: ["CP2K", "2022.1"]
# Pre-release tests
- os: ubuntu-latest
version: "3.11"
special: ["pre-release", ""]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install CP2K
run: |
case "${{ matrix.special[0] }}" in
"CP2K")
CP2K_VERSION="${{ matrix.special[1] }}" ;;
*)
CP2K_VERSION=$CP2K_DEFAULT ;;
esac
bash scripts/download_cp2k.sh x86_64 $CP2K_VERSION
- name: Info CP2K
run: cp2k.ssmp --version
- name: Install GCC
if: matrix.special[0] == 'GCC'
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.special[1] }}
platform: x64
- name: Info GCC
run: gcc --version
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
- name: Install dependencies
run: |
conda create -n test -c conda-forge python=${{ matrix.version }} boost eigen "libint>=2.6.0" highfive
source $CONDA/bin/activate test
case "${{ matrix.special[0] }}" in
"pre-release")
pip install --pre -r ./install_requirements.txt -r ./test_requirements.txt --upgrade --force-reinstall
pip install git+https://github.com/SCM-NV/qmflows@master --upgrade
pip install git+https://github.com/NLeSC/noodles@master --upgrade
;;
*)
pip install -r ./install_requirements.txt
pip install -r ./test_requirements.txt
;;
esac
- name: Conda info
run: |
source $CONDA/bin/activate test
conda info
- name: Conda list
run: conda list -n test
- name: Install the package
run: |
source $CONDA/bin/activate test
pip install -e . -vvv --no-deps
- name: Test with pytest
run: |
source $CONDA/bin/activate test
pytest -m "not (slow or long)"
- name: coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
name: codecov-umbrella
test_pypi:
name: Test python ${{ matrix.version }} (pypi) on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp39-manylinux_x86_64
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/nlesc-nano/manylinux2014_x86_64-qmflows:${{ env.TAG }}"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
- name: Install dependencies
run: |
WHL_NAME=$(python scripts/get_whl_name.py wheelhouse manylinux2014_x86_64)
pip install "$WHL_NAME"[test]
- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list
- name: Test with pytest
run: |
bash scripts/download_cp2k.sh x86_64 $CP2K_DEFAULT
bash scripts/prepare_test_dir.sh && cd /tmp/nanoqm
pytest -m "not (slow or long)"
- name: coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
name: codecov-umbrella
Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python on ubuntu-latest
uses: actions/setup-python@v4
with:
python-version: "3.*"
- name: Install linters
run: pip install -r ./linting_requirements.txt
- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list
- name: Run flake8
run: flake8 nanoqm test setup.py scripts
- name: Run pydocstyle
run: pydocstyle nanoqm
- name: Run mypy
run: mypy nanoqm setup.py scripts
continue-on-error: true