Skip to content

try mac and windows again #214

try mac and windows again

try mac and windows again #214

Workflow file for this run

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", "3.12"]
steps:
- name: Setup GNU Fortran
if: false == contains( matrix.os, 'windows')
uses: awvwgk/setup-fortran@v1
- name: Install compiler
if: false == contains( matrix.os, 'windows')
id: install_cc
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang
- name: Install mingw-w64 on Windows
if: contains( matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
path-type: inherit
update: true
msystem: MINGW64
install: >-
cmake
pkg-config
gcc
gcc-libs
gcc-fortran
openblas
openblas64
- name: Set compilers
if: contains( matrix.os, 'windows')
run: |
mv C:\\Strawberry\\perl\\bin\\pkg-config.BAT C:\\Strawberry\\perl\\bin\\old-pkg-config.old
mv C:\\Strawberry\\perl\\bin\\pkg-config C:\\Strawberry\\perl\\bin\\old-pkg-config
- name: checkout repository
uses: actions/checkout@v4
- 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/
brew install openblas libomp
- name: Linux openblas
if: contains( matrix.os, 'ubuntu')
run: |
sudo apt-get install libopenblas-dev
- name: Set compilers
if: false == contains( matrix.os, 'windows')
run: |
echo "CC=${{ steps.install_cc.outputs.cc }}" >> $GITHUB_ENV
echo "CXX=${{ steps.install_cc.outputs.cxx }}" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: cp
with:
python-version: ${{ matrix.python-version }}
update-environment: true
#- name: Setup tmate session
# if: contains( matrix.os, 'windows')
# uses: mxschmitt/action-tmate@v3
- name: Pip Install pyHAMS
run: |
'${{ steps.cp.outputs.python-path }}' -m pip install --upgrade pip
'${{ steps.cp.outputs.python-path }}' -m pip install meson-python meson numpy ninja wheel
'${{ steps.cp.outputs.python-path }}' -m pip install --no-build-isolation -e . -v
- 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 -el {0}
strategy:
fail-fast: false #true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: checkout repository
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
# https://github.com/marketplace/actions/setup-miniconda
with:
#mamba-version: "*"
miniforge-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
activate-environment: test
auto-activate-base: false
# Install dependencies of WISDEM specific to windows
# NOTE: If you install m2w64-toolchain, it includes m2w64-pkgconfig which supercedes the conda one
# The m2w64 pkgconfig fails to find openblas and the install fails
# By only including these compiler packages, the build succeeds
- name: Add dependencies windows specific
if: contains( matrix.os, 'windows')
run: |
conda install -y m2w64-binutils m2w64-gcc m2w64-gcc-libgfortran m2w64-gcc-fortran libpython
# Install dependencies of WISDEM specific to windows
- name: Add dependencies mac specific
if: contains( matrix.os, 'mac')
run: |
conda install -y compilers
gfortran --version
# Install
- name: Debug
run: |
conda list
printenv
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true
# if: contains( matrix.os, 'windows')
# Install
- name: Conda Install pyHAMS
env:
MESON_ARGS: ""
run: |
python -m pip install . -v
- name: Test run
run: |
cd test
python test_cylinder.py