Skip to content

Commit 56f0998

Browse files
committed
Merged in master
2 parents ac9d714 + 12df253 commit 56f0998

File tree

153 files changed

+5289
-4119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+5289
-4119
lines changed

.coveragerc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ source = simsopt
44

55
[paths]
66
sources =
7-
/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages
87
/opt/hostedtoolcache/Python/3.8.10/x64/lib/python3.8/site-packages
8+
/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages
99
/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages

.github/workflows/ci.yml

+90-84
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
# This appears to be a known harmless annoyance:
77
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/11122
88

9-
name: CI
9+
name: Simple CI
1010

11-
on: [push, pull_request]
11+
on:
12+
push:
13+
branches-ignore: [master]
14+
tags-ignore: [v*]
15+
pull_request:
16+
branches-ignore: [master]
1217

1318
jobs:
1419
test:
@@ -21,7 +26,7 @@ jobs:
2126
strategy:
2227
fail-fast: false
2328
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
2530
test-type: [unit, integrated]
2631

2732
steps:
@@ -55,9 +60,7 @@ jobs:
5560
# submodules: true
5661

5762
# 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.
5963
- name: Download the VMEC2000 standalone repository
60-
# run: git clone https://gitlab.com/mattland/VMEC2000.git
6164
run: git clone https://github.com/hiddensymmetries/VMEC2000.git
6265

6366
- name: ls -l again
@@ -84,9 +87,7 @@ jobs:
8487

8588
- name: Install python dependencies
8689
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
9091
9192
- name: Install booz_xform
9293
run: pip install -v git+https://github.com/hiddenSymmetries/booz_xform
@@ -164,120 +165,62 @@ jobs:
164165
- name: ls in VMEC2000/python 1
165166
run: ls -l VMEC2000/python
166167

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
174169
run: |
175170
cd VMEC2000
176171
cp python/machines/ubuntu.json cmake_config_file.json
177172
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
184173
pip install .
185174
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-
194175
- name: Try importing vmec module
195176
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__)"
196177

197178
- name: Install simsopt package
198-
# if: "contains(matrix.test-type, 'integrated')"
199179
run: pip install -v .[MPI,SPEC]
200180

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')
213183
run: |
214184
cd examples
215-
./run_examples
185+
./run_serial_examples
186+
./run_spec_examples
187+
./run_vmec_examples
188+
./run_spec_vmec_examples
216189
217190
- 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
220193

221194
- name: Run tests using coverage
222-
if: "contains(matrix.test-type, 'unit')"
195+
if: contains(matrix.test-type, 'unit')
223196
run: |
224197
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: |
225202
mpiexec -n 1 coverage run -m unittest discover -k "mpi" -s tests
226203
mpiexec -n 2 coverage run -m unittest discover -k "mpi" -s tests
227204
mpiexec -n 3 coverage run -m unittest discover -k "mpi" -s tests
228205
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-
265206
- name: Combine coverage reports
207+
if: contains(matrix.test-type, 'unit')
266208
run: |
267209
coverage combine
268210
coverage report
269211
coverage xml
270212
271213
- name: Upload coverage to github
214+
if: contains(matrix.test-type, 'unit')
272215
uses: actions/upload-artifact@v2
273216
with:
274217
name: tox-gh-actions-coverage
275218
path: coverage.xml
276219
if-no-files-found: error
277220

278221
- 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'
281224
uses: codecov/codecov-action@v1
282225
with:
283226
token: ${{ secrets.CODECOV_TOKEN }}
@@ -290,3 +233,66 @@ jobs:
290233
fail_ci_if_error: true
291234
#path_to_write_report: ./coverage/codecov_report.gz
292235
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

Comments
 (0)