-
Notifications
You must be signed in to change notification settings - Fork 71
234 lines (198 loc) · 6.85 KB
/
test_unit_and_examples.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
name: Unit test and examples
on:
push:
pull_request:
# every day at 3 am UTC
schedule:
- cron: '0 3 * * *'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
unit_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest, macos-14]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-14
python-version: 3.7
- os: macos-14
python-version: 3.8
- os: macos-14
python-version: 3.9
- os: macos-13
python-version: 3.7
- os: macos-13
python-version: 3.8
- os: macos-13
python-version: 3.9
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install-rtools
if: matrix.os == 'windows-latest'
run: |
choco install rtools --version=4.0.0.20220206 --no-progress --force
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
- name: Install system dependencies in Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt install -y gfortran ngspice python3-tk libboost-all-dev libopenblas-dev libfftw3-dev libsuitesparse-dev
- name: Install system dependencies in MacOS
if: >-
( contains(matrix.os, 'macos') )
run: |
brew reinstall gfortran openblas pkg-config
brew install ngspice boost suite-sparse
- name: Install system dependencies in Windows
if: matrix.os == 'windows-latest'
run: choco install ngspice
- name: Install Python dependecies
run: |
pip install --upgrade pip
pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
pip install pytest meson-python ninja cython spin
python3 -m spin install-dependencies -test-dep
# - name: Install S4 (macOS - x86)
# if: matrix.os == 'macos-13'
# run: |
# pip install wheel setuptools
# git clone https://github.com/phoebe-p/S4
# cd S4
# make S4_pyext --file="Makefile.mac_intel"
# cd ..
# rm -rf S4
- name: Install S4 (macOS - arm)
if: matrix.os == 'macos-14'
run: |
pip install wheel setuptools
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext --file="Makefile.m1"
cd ..
rm -rf S4
- name: Install S4 (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
pip install wheel setuptools
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext
cd ..
rm -rf S4
- name: Build solcore
run: |
python -m spin build -- -Dwith_pdd=true -Dinstall_test=true
- name: Unit and functional tests (MacOS and Linux)
if: matrix.os != 'windows-latest'
env:
SOLCORE_SPICE: ngspice
run: |
python -m spin test -- -r a -v --cov=solcore/ --ignore=solcore/tests/test_examples.py -n "auto"
- name: Unit and functional tests (Windows)
if: matrix.os == 'windows-latest'
run: |
cd D:\a\solcore5\solcore5\build-install\usr\Lib\site-packages
python -m pytest -r a -v --ignore=solcore/tests/test_examples.py -n "auto"
- name: Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
python -m pip install codecov
python -m spin codecov
test_examples:
needs: unit_test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest, macos-14]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-14
python-version: 3.7
- os: macos-14
python-version: 3.8
- os: macos-14
python-version: 3.9
- os: macos-13
python-version: 3.7
- os: macos-13
python-version: 3.8
- os: macos-13
python-version: 3.9
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install-rtools
if: matrix.os == 'windows-latest'
run: |
choco install rtools --version=4.0.0.20220206 --no-progress --force
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
- name: Install system dependencies in Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt install -y gfortran ngspice python3-tk libboost-all-dev libopenblas-dev libfftw3-dev libsuitesparse-dev
- name: Install system dependencies in MacOS
if: >-
( contains(matrix.os, 'macos') )
run: |
brew reinstall gfortran openblas pkg-config
brew install ngspice boost suite-sparse
- name: Install system dependencies in Windows
if: matrix.os == 'windows-latest'
run: choco install ngspice
- name: Install Python dependecies
run: |
pip install --upgrade pip
pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
pip install pytest meson-python ninja cython spin
python3 -m spin install-dependencies -test-dep
# - name: Install S4 (macOS - x86)
# if: if: matrix.os == 'macos-13'
# run: |
# pip install wheel setuptools
# git clone https://github.com/phoebe-p/S4
# cd S4
# make S4_pyext --file="Makefile.mac_intel"
# cd ..
# rm -rf S4
- name: Install S4 (macOS - arm)
if: matrix.os == 'macos-14'
run: |
pip install wheel setuptools
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext --file="Makefile.m1"
cd ..
rm -rf S4
- name: Install S4 (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
pip install wheel setuptools
git clone https://github.com/phoebe-p/S4
cd S4
make S4_pyext
cd ..
rm -rf S4
- name: Build solcore
run: |
python -m spin build -- -Dwith_pdd=true -Dinstall_test=true
- name: Unit and functional tests (MacOS and Linux)
if: matrix.os != 'windows-latest'
env:
SOLCORE_SPICE: ngspice
run: |
python -m spin test -- -r a -v solcore/tests/test_examples.py -n "auto"