Update version to 0.0.6 #169
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is based on examples in | |
# https://docs.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: [push, pull_request] | |
jobs: | |
CI: | |
strategy: | |
fail-fast: false | |
matrix: | |
# If os = macos-latest, the extension builds ok, but there is a seg fault when trying to use it. | |
os: [ubuntu-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
use-pip: [yes-pip, no-pip] | |
runs-on: ${{ matrix.os }} | |
steps: | |
# First print out lots of information. We do this in separate | |
# "name" blocks because otherwise the output gets mixed together | |
# in the github actions log. | |
- name: PWD | |
run: pwd | |
- name: apt-get any needed packages | |
if: "contains(matrix.os, 'ubuntu')" | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential gfortran openmpi-bin libopenmpi-dev libnetcdf-dev libnetcdff-dev liblapack-dev libscalapack-mpi-dev libhdf5-openmpi-dev git | |
# Github Actions macos environment contains gfortran-9 and gfortran-10 but not a plain gfortran. | |
# We must create a symlink so mpif90 can find a plain gfortran. | |
- name: get any needed packages from homebrew | |
if: "contains(matrix.os, 'macos')" | |
run: | | |
brew install netcdf open-mpi scalapack | |
ln -s /usr/local/bin/gfortran-9 /usr/local/bin/gfortran | |
- name: Print all mpi commands | |
run: compgen -c mpi | sort | |
- name: Confirm that gfortran can be found | |
run: compgen -c g | sort | |
- name: Print versions | |
run: | | |
which mpicc | |
which mpiexec | |
which mpifort | |
which mpif90 | |
mpicc --version | |
mpif90 --version | |
cmake --version | |
which gfortran | |
gfortran --version | |
#mpifort --version | |
- uses: actions/checkout@v4 | |
# If we want submodules downloaded, uncomment the next 2 lines: | |
#with: | |
# submodules: true | |
- name: ls | |
run: ls -l | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: which python after python setup | |
run: python --version | |
- name: Update pip | |
run: | | |
python -m pip install --upgrade pip | |
# pip install fails unless numpy is manually installed first, I think due to a problem with dependencies for f90wrap. | |
# mpi4py is not needed for installation, but it is needed to actually do anything with the vmec python module. | |
# scipy is not needed for the vmec module itself, but we use it for testing (to read netcdf). | |
- name: Install python packages | |
run: pip install numpy mpi4py scipy | |
#- name: Install the latest version of f90wrap, more recent than the PyPI version | |
# run: pip install git+https://github.com/jameskermode/f90wrap | |
- name: env after adding python | |
run: env | |
- name: Install more python packages | |
# If using 'pip install', these packages should be included automatically. | |
if: "contains(matrix.use-pip, 'no-pip')" | |
run: | | |
pip install wheel scikit-build ninja | |
pip install f90wrap | |
- name: List installed python packages | |
run: pip list | |
- name: Set cmake_config_file.json for ubuntu | |
if: "contains(matrix.os, 'ubuntu')" | |
run: cp cmake/machines/ubuntu.json cmake_config_file.json | |
- name: Set cmake_config_file.json for macos | |
if: "contains(matrix.os, 'macos')" | |
run: cp cmake/machines/mac_ci.json cmake_config_file.json | |
- name: Verify new cmake_config_file.json is in place | |
run: cat cmake_config_file.json | |
- name: Install using pip install | |
if: "contains(matrix.use-pip, 'yes-pip')" | |
run: pip install -v . | |
- name: Install using python setup.py install | |
if: "contains(matrix.use-pip, 'no-pip')" | |
run: python setup.py install | |
- name: Try import | |
run: python -c "import vmec; print('Import vmec succeeded')" | |
- name: Run python unit tests | |
run: ./python/run_tests_mpi |