Add wrapper for eigen mode anaysis of dynamic stability #248
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: Wheel builder and tester | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} ${{ matrix.buildplat[2] }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
matrix: | |
buildplat: | |
# Not supported for now | |
# - [ubuntu-22.04, musllinux, x86_64] | |
# - [windows-2019, win, AMD64] | |
# - [macos-12, macosx, arm64] | |
# working | |
- [ubuntu-22.04, manylinux, x86_64] | |
- [macos-12, macosx, x86_64, openblas, "10.13"] | |
- [macos-14, macosx, arm64, openblas, "12.3"] | |
# accelerate causes a segfault for some reason... | |
# - [macos-13, macosx, x86_64, accelerate, "14.0"] | |
# - [macos-14, macosx, arm64, accelerate, "14.0"] | |
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]] | |
# python: [["cp310", "3.10"]] | |
env: | |
IS_32_BIT: ${{ matrix.buildplat[2] == 'x86' }} | |
steps: | |
- name: Checkout pyAVL | |
uses: actions/checkout@v4 | |
# Used to host cibuildwheel | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: win_amd64 - install rtools | |
run: | | |
# mingw-w64 | |
choco install rtools --no-progress | |
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH | |
if: ${{ runner.os == 'Windows' && env.IS_32_BIT == 'false' }} | |
- name: Setup macOS | |
if: startsWith( matrix.buildplat[0], 'macos-' ) | |
run: | | |
if [[ ${{ matrix.buildplat[3] }} == 'accelerate' ]]; then | |
echo CIBW_CONFIG_SETTINGS=\"setup-args=-Dblas=accelerate\" >> "$GITHUB_ENV" | |
# Always use preinstalled gfortran for Accelerate builds | |
ln -s $(which gfortran-13) gfortran | |
export PATH=$PWD:$PATH | |
echo "PATH=$PATH" >> "$GITHUB_ENV" | |
LIB_PATH=$(dirname $(gfortran --print-file-name libgfortran.dylib)) | |
fi | |
# Add libraries installed by cibw_before_build_macos.sh to path | |
if [[ ${{ matrix.buildplat[2] }} == 'arm64' ]]; then | |
LIB_PATH=$LIB_PATH:/opt/arm64-builds/lib | |
else | |
LIB_PATH=$LIB_PATH:/usr/local/lib | |
fi | |
if [[ ${{ matrix.buildplat[4] }} == '10.13' ]]; then | |
# 20240621 macos-12 images span Xcode 13.1-->14.2 | |
XCODE_VER='13.4.1' | |
else | |
XCODE_VER='15.2' | |
fi | |
CIBW="sudo xcode-select -s /Applications/Xcode_${XCODE_VER}.app" | |
echo "CIBW_BEFORE_ALL=$CIBW" >> $GITHUB_ENV | |
# setting SDKROOT necessary when using the gfortran compiler | |
# installed in cibw_before_build_macos.sh | |
sudo xcode-select -s /Applications/Xcode_${XCODE_VER}.app | |
CIBW="MACOSX_DEPLOYMENT_TARGET=${{ matrix.buildplat[4] }}\ | |
LD_LIBRARY_PATH=$LIB_PATH:$LD_LIBRARY_PATH\ | |
PKG_CONFIG_PATH=$LIB_PATH/pkgconfig\ | |
SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" | |
echo "CIBW_ENVIRONMENT_MACOS=$CIBW" >> "$GITHUB_ENV" | |
echo "REPAIR_PATH=$LIB_PATH" >> "$GITHUB_ENV" | |
GFORTRAN_LIB="\$(dirname \$(gfortran --print-file-name libgfortran.dylib))" | |
CIBW="DYLD_LIBRARY_PATH=$GFORTRAN_LIB:$LIB_PATH delocate-listdeps {wheel} &&\ | |
DYLD_LIBRARY_PATH=$GFORTRAN_LIB:$LIB_PATH delocate-wheel --require-archs \ | |
{delocate_archs} -w {dest_dir} {wheel}" | |
# Rename x86 Accelerate wheel to test on macOS 13 runner | |
if [[ ${{ matrix.buildplat[0] }} == 'macos-13' && ${{ matrix.buildplat[4] }} == '14.0' ]]; then | |
CIBW+=" && mv {dest_dir}/\$(basename {wheel}) \ | |
{dest_dir}/\$(echo \$(basename {wheel}) | sed 's/14_0/13_0/')" | |
fi | |
echo "CIBW_REPAIR_WHEEL_COMMAND_MACOS=$CIBW" >> "$GITHUB_ENV" | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}* | |
CIBW_ARCHS: ${{ matrix.buildplat[2] }} | |
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS | |
- uses: actions/upload-artifact@v4 | |
name: upload the wheels | |
with: | |
path: ./wheelhouse/*.whl | |
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} | |
${{ matrix.buildplat[2] }} ${{ matrix.buildplat[3] }} | |
${{ matrix.buildplat[4] }} | |
upload_all: | |
name: upload the wheels to PYPI | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
steps: | |
- name: what is going on | |
run: pwd & ls -R | |
- name: Checkout pyAVL | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
id: download | |
name: download the wheels | |
with: | |
path: wheelhouse | |
- name: 'Echo download path' | |
run: echo ${{steps.download.outputs.download-path}} | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: make dist dir | |
run: mkdir dist | |
- name: Move wheels to dist | |
run: bash tools/wheels/move_wheels.sh | |
- name: Publish distribution 📦 to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
# packages-dir: wheelhouse/ | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
skip-existing: true | |
repository-url: https://test.pypi.org/legacy/ | |
- name: Publish distribution 📦 to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
# packages-dir: wheelhouse/ | |
skip-existing: true | |
password: ${{ secrets.PYPI_API_TOKEN }} |