libmcphase #11
Workflow file for this run
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
# Adapted from https://github.com/RalfG/python-wheels-manylinux-build/blob/master/full_workflow_example.yml | |
name: libmcphase | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
types: [opened, reopened, synchronize] | |
release: | |
types: [published] | |
workflow_dispatch: | |
concurrency : | |
group: ${{ github.workflow }}-${{ github.ref == 'refs/head/main' && github.run_number || github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build_and_test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
name: Build and test, ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2 | |
env: | |
CIBW_BUILD: "cp38-* cp39* cp310-* cp311-* cp312-*" | |
CIBW_SKIP: "*musllinux* *win32* *i686*" | |
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" | |
CIBW_BUILD_VERBOSITY: 1 | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
cache-downloads: true | |
- name: Install wheels and run test | |
run: | | |
# set -e makes sure the script fails if any command in the loop fails | |
set -e | |
for pyver in 3.8 3.9 3.10 3.11 3.12 | |
do | |
$MAMBA_EXE create -n py$pyver -c conda-forge python=$pyver numpy | |
eval "$($MAMBA_EXE shell activate py$pyver)" | |
python -m pip install wheelhouse/*cp$(echo $pyver | sed s/\\.//)* | |
cd tests | |
python -m unittest | |
cd .. | |
done | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }}_artifacts.zip | |
path: wheelhouse/* | |
#- name: Setup tmate | |
# if: ${{ failure() }} | |
# uses: mxschmitt/action-tmate@v3 | |
#- name: Publish wheels to PyPI | |
# if: ${{ github.event_name == 'release' }} | |
# env: | |
# TWINE_USERNAME: __token__ | |
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
# run: | | |
# twine upload wheelhouse/* |