Skip to content

Commit

Permalink
Update CI (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet committed Jan 29, 2024
1 parent b4279ff commit 327377c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
41 changes: 25 additions & 16 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,50 @@ on:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

env:
CIBW_BEFORE_BUILD: "pip install pybind11"
CIBW_BEFORE_TEST_MACOS: "pip cache remove numpy; brew install openblas; OPENBLAS=\"$(brew --prefix openblas)\" pip install --no-cache-dir -U pip numpy"
CIBW_TEST_REQUIRES: "pytest numpy"
CIBW_TEST_SKIP: "*-musllinux_* *-manylinux_i686 pp39-manylinux_x86_64 pp*-win_amd64 pp*-macosx_x86_64"
CIBW_TEST_COMMAND: "pytest {project}/src"
CIBW_BUILD_VERBOSITY: 1

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-10.15]
os: [ubuntu-20.04, windows-2019, macOS-11]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pypa/cibuildwheel@v2.4.0
- uses: actions/upload-artifact@v2
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v5

- name: Install cibuildwheel
run: python -m pip install cibuildwheel

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD: "pip install pybind11"
CIBW_BEFORE_TEST_MACOS: "pip cache remove numpy; brew install openblas; OPENBLAS=\"$(brew --prefix openblas)\" pip install --no-cache-dir -U pip numpy"
CIBW_TEST_REQUIRES: "pytest numpy"
CIBW_TEST_SKIP: "*-musllinux_* *-manylinux_i686 pp39-manylinux_x86_64 pp*-win_amd64 pp*-macosx_x86_64"
CIBW_TEST_COMMAND: "pytest {project}/src"
CIBW_BUILD_VERBOSITY: 1

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
retention-days: 1

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist --outdir wheelhouse

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.tar.gz
retention-days: 1
Expand All @@ -54,12 +63,12 @@ jobs:
# Upload to PyPI on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: wheelhouse

- uses: pypa/gh-action-pypi-publish@v1.5.0
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def build_extensions(self):
long_description=README,
long_description_content_type="text/markdown",
ext_modules=ext_modules,
python_requires=">=3.8",
install_requires=['pybind11>=2.1.0'],
setup_requires=['pybind11>=2.1.0', 'setuptools_scm'],
cmdclass={'build_ext': BuildExt},
Expand Down

0 comments on commit 327377c

Please sign in to comment.