Skip to content

Merge pull request #54 from embotech/p-numpy-2-compatible #83

Merge pull request #54 from embotech/p-numpy-2-compatible

Merge pull request #54 from embotech/p-numpy-2-compatible #83

Workflow file for this run

name: build
on:
pull_request:
push:
branches:
- master
tags:
- '*'
jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, macos-11, windows-2019 ]
python-version: [ 3.7, 3.9, 3.8, "3.10", "3.11", "3.12" ]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,anaconda
- name: Install
run: |
if [[ "$PYTHON_VERSION" == "3.7" ]] || [[ "$PYTHON_VERSION" == "3.8" ]]; then
conda install scipy=1.3 numpy=1.16 pytest
elif [[ "$PYTHON_VERSION" == "3.9" ]]; then
conda install scipy=1.5 numpy=1.19 pytest
elif [[ "$PYTHON_VERSION" == "3.10" ]]; then
conda install scipy=1.7 numpy=1.21 pytest
elif [[ "$PYTHON_VERSION" == "3.11" ]]; then
conda install scipy=1.9.3 numpy=1.23.4 pytest
elif [[ "$PYTHON_VERSION" == "3.12" ]]; then
conda install scipy=1.11.3 numpy=1.26.0 pytest
fi
if [[ "$RUNNER_OS" == "macOS" ]]; then
sudo rm -rf /Library/Developer/CommandLineTools
fi
- name: Test
run: |
make install
python -m pytest
rm -rf build/
build_wheels:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, macos-11, windows-2019 ]
python-version: [ 3.7, 3.9, "3.10", "3.11", "3.12" ]
include:
- os: ubuntu-20.04
python-version: 3.8
single_action_config: "True"
- os: macos-11
python-version: 3.8
- os: windows-2019
python-version: 3.8
env:
RUNNER_OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' }}"
PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set Additional Envs
shell: bash
run: |
echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
echo "DEPLOY_PYPI_SOURCE=$( [[ $PYTHON_VERSION == 3.8 && $RUNNER_OS == 'macOS' ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
- name: Build wheels
if: ${{env.DEPLOY == 'True'}}
env:
CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
uses: joerick/[email protected]
- name: Build source
if: ${{env.DEPLOY == 'True' && env.SINGLE_ACTION_CONFIG == 'True'}}
run: |
python setup.py sdist --dist-dir=wheelhouse
- name: Release to pypi
if: ${{env.DEPLOY == 'True'}}
shell: bash
run: |
python -m pip install --upgrade twine
twine check wheelhouse/*
twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD
- name: Upload artifacts to github
if: ${{env.DEPLOY == 'True'}}
uses: actions/upload-artifact@v1
with:
name: wheels
path: ./wheelhouse