Skip to content

fixed github actions: wheel building #307

fixed github actions: wheel building

fixed github actions: wheel building #307

Workflow file for this run

name: tests
on:
pull_request:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: ${{ github.ref == 'master' }}
jobs:
run_tests:
strategy:
fail-fast: true
matrix:
os-python-env:
- [ubuntu-20.04, "3.6", "CONVTOOLS_CEXT_DISABLED=1"]
- [ubuntu-20.04, "3.7", "CONVTOOLS_CEXT_DISABLED=1"]
- [ubuntu-20.04, "3.8", "CONVTOOLS_CEXT_DISABLED=1"]
- [ubuntu-20.04, "3.9", "CONVTOOLS_CEXT_DISABLED=1"]
- [ubuntu-20.04, "3.10", "CONVTOOLS_CEXT_DISABLED=1"]
- [ubuntu-20.04, "3.11", "CONVTOOLS_CEXT_DISABLED=1"]
- [ubuntu-20.04, "3.12", "CONVTOOLS_CEXT_DISABLED=1"]
- [ubuntu-20.04, "3.10", "CONVTOOLS_CEXT_DISABLED=0"]
runs-on: ${{ matrix.os-python-env[0] }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.os-python-env[1] }}
- name: run tests
if: ${{ matrix.os-python-env[1] != '3.10' }}
run: |
pip install -r ci-requirements/requirements${{ matrix.os-python-env[1] }}.out
${{ matrix.os-python-env[2] }} pip install -e .
pytest --benchmark-skip --no-cov
- name: run tests & lint
if: ${{ matrix.os-python-env[1] == '3.10' }}
run: |
pip install -r ci-requirements/requirements${{ matrix.os-python-env[1] }}.out
black src tests --check
isort src tests --check
ruff check src
mypy --check-untyped-defs src
${{ matrix.os-python-env[2] }} pip install -e .
pytest --benchmark-skip --no-cov
build_sdist:
name: Build source distribution
if: startsWith(github.ref, 'refs/tags/')
needs:
- run_tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: upload coverage
run: |
pip install -r ci-requirements/requirements3.10.out
find src/convtools -name "*.so" -delete
CONVTOOLS_CEXT_DISABLED=1 pip install -e .
pytest --benchmark-skip
CONVTOOLS_CEXT_DISABLED=0 pip install -e .
pytest --benchmark-skip --cov-append
bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
- name: build sdist
run: |
pip install -U pip build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: ./dist/*.tar.gz
build_wheels:
name: Build wheels
if: startsWith(github.ref, 'refs/tags/')
needs:
- run_tests
strategy:
matrix:
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [ubuntu-20.04, musllinux_x86_64]
- [macos-13, macosx_x86_64]
- [macos-14, macosx_arm64]
- [windows-2019, win_amd64]
- [windows-2019, win_arm64]
runs-on: ${{ matrix.buildplat[0] }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_BUILD: cp310-${{ matrix.buildplat[1] }}
CIBW_BEFORE_TEST: pip install -r ci-requirements/requirements3.10.out
CIBW_TEST_COMMAND: pytest --benchmark-skip --no-cov
- uses: actions/upload-artifact@v4
with:
name: artifact-cp310-${{ matrix.buildplat[1] }}
path: ./wheelhouse/*.whl
pypi-publish:
name: Upload release to PyPI
if: startsWith(github.ref, 'refs/tags/')
needs:
- build_sdist
- build_wheels
runs-on: ubuntu-20.04
environment:
name: pypi
url: https://pypi.org/p/convtools
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
path: dist/
pattern: artifact-*
- name: Release
uses: softprops/action-gh-release@v2
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1