expand environment #124
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
name: CI_pyHAMS | |
# We run CI on push commits and pull requests on all branches | |
on: [push, pull_request] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build_pip: | |
name: Pip Build (${{ matrix.os }}) - ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false #true | |
matrix: | |
os: ["ubuntu-latest", "macOS-latest"] #, "windows-latest"] | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Setup GNU Fortran | |
# if: false == contains( matrix.os, 'windows') | |
uses: awvwgk/setup-fortran@main #modflowpy/install-intelfortran-action@v1 # | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
id: cp | |
with: | |
python-version: ${{ matrix.python-version }} | |
update-environment: true | |
- name: Windows openblas | |
if: contains( matrix.os, 'windows') | |
run: | | |
#vcpkg install openblas | |
#pacman -S mingw-w64-x86_64-openblas64 | |
'${{ steps.cp.outputs.python-path }}' -m pip install pylib-openblas | |
- name: Mac openblas | |
if: contains( matrix.os, 'mac') | |
run: | | |
#export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig:$PKG_CONFIG_PATH" | |
sudo ln -s /usr/local/opt/openblas/lib/libopenblas* /usr/local/lib/ | |
- name: Linux openblas | |
if: contains( matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get install libopenblas-dev | |
#- name: Setup tmate session | |
# if: contains( matrix.os, 'windows') | |
# uses: mxschmitt/action-tmate@v3 | |
- name: Pip Install pyHAMS | |
env: | |
MESON_ARGS: -Dpython_target=${{ steps.cp.outputs.python-path }} | |
run: | | |
'${{ steps.cp.outputs.python-path }}' -m pip install -vv -e . | |
- name: Test run | |
run: | | |
cd test | |
'${{ steps.cp.outputs.python-path }}' test_cylinder.py | |
build_conda: | |
name: Conda Build (${{ matrix.os }}) - ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false #true | |
matrix: | |
os: ["ubuntu-latest", "macOS-latest", "windows-latest"] | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
# https://github.com/marketplace/actions/setup-miniconda | |
with: | |
mamba-version: "*" | |
miniconda-version: "latest" | |
#auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
environment-file: environment.yml | |
channels: conda-forge | |
channel-priority: true | |
activate-environment: test | |
auto-activate-base: false | |
# Install dependencies of WISDEM specific to windows | |
- name: Add dependencies windows specific | |
if: contains( matrix.os, 'windows') | |
run: | | |
mamba install -y m2w64-toolchain libpython | |
mamba list | |
# Install dependencies of WISDEM specific to windows | |
- name: Add dependencies mac specific | |
if: contains( matrix.os, 'mac') | |
run: | | |
mamba install -y compilers | |
gfortran --version | |
# Install | |
- name: Conda Install pyHAMS | |
env: | |
MESON_ARGS: "" | |
run: | | |
python setup.py develop | |
- name: Test run | |
run: | | |
cd test | |
python test_cylinder.py | |