forked from PrincetonUniversity/SPEC
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (74 loc) · 2.62 KB
/
python_wrapper.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
name: python_wrapper
on: [push, pull_request]
jobs:
python_wrapper-build:
runs-on: ubuntu-latest
name: python_wrapper build
steps:
- uses: actions/checkout@v4
# Python3 should be pre-installed on 'ubuntu-latest'
- name: Python version info
run: |
python --version
pip --version
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gfortran mpi-default-bin mpi-default-dev libhdf5-dev libfftw3-bin libfftw3-dev libopenblas-dev cmake ninja-build
pip install numpy f90nml scikit-build scipy meson meson-python
pip install f90wrap
- name: Build python_wrapper
run: |
pip install .
- name: Test if installation is ok
run: |
python -c "import spec; print('success')"
conda-build-ubuntu:
runs-on: ${{ matrix.os }}
name: python_wrapper conda build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.11"] # "3.12" is failing due to the new setuptools
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
# Or using the command conda env create --file environment.yml
with:
miniconda-version: "latest"
environment-name: spec_wrapper
environment-file: spec_env.yml
python-version: ${{ matrix.python-version }}
activate-environment: spec_wrapper
- name: conda environment
run: conda env export
- name: pip environment
run: pip freeze
- name: Test if installation is ok
run: |
python -c "import spec; print('success')"
python -c "import py_spec; print('py_spec success')"
python -c "import py_spec; input_namelist = py_spec.input.SPECNamelist('ci/G3V08L3Fi/G3V08L3Fi.001.sp'); equilibrium = input_namelist.run(force=True); equilibrium.plot_poincare()"
conda-install-f90wrap-mac:
runs-on: macos-latest
name: python_wrapper conda install f90wrap
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-name: test_env
environment-file: minimalenv.yml
python-version: "3.11"
activate-environment: test_env
- name: conda environment
run: conda env export
- name: pip environment
run: pip freeze
- name: Test if installation is ok
run: |
python -c "import f90wrap; print('success')"