6
6
# This appears to be a known harmless annoyance:
7
7
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/11122
8
8
9
- name : CI
9
+ name : Simple CI
10
10
11
- on : [push, pull_request]
11
+ on :
12
+ push :
13
+ branches-ignore : [master]
14
+ tags-ignore : [v*]
15
+ pull_request :
16
+ branches-ignore : [master]
12
17
13
18
jobs :
14
19
test :
21
26
strategy :
22
27
fail-fast : false
23
28
matrix :
24
- python-version : [3.7.10, 3. 8.10, 3.9.5 ] # To sync with coveragerc
29
+ python-version : [3.8.10] # To sync with coveragerc
25
30
test-type : [unit, integrated]
26
31
27
32
steps :
55
60
# submodules: true
56
61
57
62
# We must run actions/checkout@v2 before downloading and building VMEC, since checkout deletes the contents of the directory.
58
- # For now we use the mattland fork of VMEC. Once changes are pushed to mbkumar's fork, we can use that instead.
59
63
- name : Download the VMEC2000 standalone repository
60
- # run: git clone https://gitlab.com/mattland/VMEC2000.git
61
64
run : git clone https://github.com/hiddensymmetries/VMEC2000.git
62
65
63
66
- name : ls -l again
84
87
85
88
- name : Install python dependencies
86
89
run : |
87
- #pip install wheel numpy scipy jax jaxlib cmake scikit-build ninja f90nml h5py pyoculus qsc sympy
88
- pip install wheel numpy f90nml scikit-build cmake qsc sympy
89
- # qsc is used for an integrated test.
90
+ pip install wheel numpy f90nml scikit-build cmake qsc sympy pyevtk
90
91
91
92
- name : Install booz_xform
92
93
run : pip install -v git+https://github.com/hiddenSymmetries/booz_xform
@@ -164,120 +165,62 @@ jobs:
164
165
- name : ls in VMEC2000/python 1
165
166
run : ls -l VMEC2000/python
166
167
167
- # - name: Configure VMEC2000 module
168
- # run: |
169
- # cd VMEC2000/python
170
- # cp ubuntu.json cmake_config_file.json
171
- # cat cmake_config_file.json
172
-
173
- - name : Configure VMEC2000 module
168
+ - name : Configure and install VMEC2000 module
174
169
run : |
175
170
cd VMEC2000
176
171
cp python/machines/ubuntu.json cmake_config_file.json
177
172
cat cmake_config_file.json
178
-
179
- - name : Build and install VMEC2000 module
180
- run : |
181
- # cd VMEC2000/python
182
- # python setup.py build_ext
183
- cd VMEC2000
184
173
pip install .
185
174
186
- # - name: Install VMEC2000 module
187
- # run: |
188
- # cd VMEC2000/python
189
- # python setup.py install
190
-
191
- # - name: ls in VMEC2000/python 2
192
- # run: ls -l VMEC2000/python
193
-
194
175
- name : Try importing vmec module
195
176
run : python -c "print(dir()); import vmec; print(dir()); print(dir(vmec)); print('package:', vmec.__package__); print('spec:', vmec.__spec__); print('doc:', vmec.__doc__); print('file:', vmec.__file__); print('path:', vmec.__path__)"
196
177
197
178
- name : Install simsopt package
198
- # if: "contains(matrix.test-type, 'integrated')"
199
179
run : pip install -v .[MPI,SPEC]
200
180
201
- # - name: Run mpi unit tests
202
- # if: "contains(matrix.test-type, 'unit')"
203
- # run: ./run_tests_mpi
204
-
205
- # - name: Run serial unit tests
206
- # if: "contains(matrix.test-type, 'unit')"
207
- # run: |
208
- # cd tests
209
- # python3 -m unittest -v
210
-
211
- - name : Run examples as integrated tests
212
- if : " contains(matrix.test-type, 'integrated')"
181
+ - name : Run examples as part of integrated tests
182
+ if : contains(matrix.test-type, 'integrated')
213
183
run : |
214
184
cd examples
215
- ./run_examples
185
+ ./run_serial_examples
186
+ ./run_spec_examples
187
+ ./run_vmec_examples
188
+ ./run_spec_vmec_examples
216
189
217
190
- name : Install coverage dependencies
218
- if : " contains(matrix.test-type, 'unit')"
219
- run : pip install coverage # tox tox-gh-actions tox-venv
191
+ if : contains(matrix.test-type, 'unit')
192
+ run : pip install coverage
220
193
221
194
- name : Run tests using coverage
222
- if : " contains(matrix.test-type, 'unit')"
195
+ if : contains(matrix.test-type, 'unit')
223
196
run : |
224
197
coverage run --source=simsopt -m unittest discover -s tests
198
+
199
+ - name : Run tests using coverage
200
+ if : contains(matrix.test-type, 'unit')
201
+ run : |
225
202
mpiexec -n 1 coverage run -m unittest discover -k "mpi" -s tests
226
203
mpiexec -n 2 coverage run -m unittest discover -k "mpi" -s tests
227
204
mpiexec -n 3 coverage run -m unittest discover -k "mpi" -s tests
228
205
229
- - name : Upload uncombined coverage to github
230
- if : " contains(matrix.test-type, 'unit')"
231
- uses : actions/upload-artifact@v2
232
- with :
233
- name : gh-actions-parallel-coverage
234
- path : .coverage.*
235
- if-no-files-found : error
236
-
237
- coverage :
238
- runs-on : ubuntu-18.04
239
- needs : [ test ]
240
- steps :
241
-
242
- - name : Set up Python
243
- uses : actions/setup-python@v2
244
- with :
245
- python-version : 3.7.10
246
-
247
- - name : Install coverage
248
- run : pip install coverage
249
-
250
- - name : Checkout simsopt
251
- uses : actions/checkout@v2
252
-
253
- - name : Install simsopt before running coverage
254
- run : pip install .
255
-
256
- - name : Download artifact
257
- uses : actions/download-artifact@v2
258
- with :
259
- name : gh-actions-parallel-coverage
260
- path : ./
261
-
262
- - name : Display coverage files before combine
263
- run : ls -a
264
-
265
206
- name : Combine coverage reports
207
+ if : contains(matrix.test-type, 'unit')
266
208
run : |
267
209
coverage combine
268
210
coverage report
269
211
coverage xml
270
212
271
213
- name : Upload coverage to github
214
+ if : contains(matrix.test-type, 'unit')
272
215
uses : actions/upload-artifact@v2
273
216
with :
274
217
name : tox-gh-actions-coverage
275
218
path : coverage.xml
276
219
if-no-files-found : error
277
220
278
221
- name : Upload coverage to Codecov
279
- # The next line prevents github from trying to upload to Codecov on forks of the repository, avoiding a permissions error
280
- if : ${{ github.repository_owner == 'hiddenSymmetries' }}
222
+ # The last conditional on the next line prevents github from trying to upload to Codecov on forks of the repository, avoiding a permissions error
223
+ if : contains(matrix.test-type, 'unit') && github.repository_owner == 'hiddenSymmetries'
281
224
uses : codecov/codecov-action@v1
282
225
with :
283
226
token : ${{ secrets.CODECOV_TOKEN }}
@@ -290,3 +233,66 @@ jobs:
290
233
fail_ci_if_error : true
291
234
# path_to_write_report: ./coverage/codecov_report.gz
292
235
verbose : true
236
+
237
+ # - name: Upload uncombined coverage to github
238
+ # if: contains(matrix.test-type, 'unit')
239
+ # uses: actions/upload-artifact@v2
240
+ # with:
241
+ # name: gh-actions-parallel-coverage
242
+ # path: .coverage.*
243
+ # if-no-files-found: error
244
+ #
245
+ # coverage:
246
+ # runs-on: ubuntu-18.04
247
+ # needs: [ test ]
248
+ # steps:
249
+ #
250
+ # - name: Set up Python
251
+ # uses: actions/setup-python@v2
252
+ # with:
253
+ # python-version: 3.8.10
254
+ #
255
+ # - name: Install coverage
256
+ # run: pip install coverage
257
+ #
258
+ # - name: Checkout simsopt
259
+ # uses: actions/checkout@v2
260
+ #
261
+ # - name: Install simsopt before running coverage
262
+ # run: pip install .
263
+ #
264
+ # - name: Download artifact
265
+ # uses: actions/download-artifact@v2
266
+ # with:
267
+ # name: gh-actions-parallel-coverage
268
+ # path: ./
269
+ #
270
+ # - name: Display coverage files before combine
271
+ # run: ls -a
272
+ #
273
+ # - name: Combine coverage reports
274
+ # run: |
275
+ # coverage combine
276
+ # coverage report
277
+ # coverage xml
278
+ #
279
+ # - name: Upload coverage to github
280
+ # uses: actions/upload-artifact@v2
281
+ # with:
282
+ # name: tox-gh-actions-coverage
283
+ # path: coverage.xml
284
+ # if-no-files-found: error
285
+ #
286
+ # - name: Upload coverage to Codecov
287
+ # uses: codecov/codecov-action@v1
288
+ # with:
289
+ # token: ${{ secrets.CODECOV_TOKEN }}
290
+ # file: ./coverage.xml
291
+ # #files: ./coverage1.xml,./coverage2.xml
292
+ # #directory: ./coverage/reports/
293
+ # flags: unittests
294
+ # env_vars: PYTHON
295
+ # name: codecov-umbrella
296
+ # fail_ci_if_error: true
297
+ # #path_to_write_report: ./coverage/codecov_report.gz
298
+ # verbose: true
0 commit comments