v0.6.0 #254
Workflow file for this run
This file contains hidden or 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: ci | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [windows-latest, macos-latest, ubuntu-latest] | |
python-version: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pybind11 setuptools coverage | |
- name: Install | |
run: python -m pip install .[tests] | |
- name: Test | |
run: coverage run -m pytest | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
test-docs: | |
permissions: | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pybind11 setuptools | |
- name: Install | |
run: pip install .[docs] | |
- name: Build documentation | |
run: | | |
cd docs | |
make html | |
build_sdist: | |
name: Build source distribution | |
needs: [build-and-test, test-docs] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- name: Check metadata | |
run: pipx run twine check dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.tar.gz | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
needs: [build-and-test, test-docs] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pypa/cibuildwheel@v2.23.2 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
docs: | |
name: Document | |
needs: [build_wheels, build_sdist] | |
if: github.event_name == 'release' && github.event.action == 'published' | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pybind11 setuptools | |
- name: Install | |
run: pip install .[docs] | |
- name: Build documentation | |
run: | | |
cd docs | |
make html | |
- name: Setup pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "docs/build/html/" | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
release: | |
name: Release | |
needs: [build_wheels, build_sdist] | |
if: github.event_name != 'release' || github.event.action != 'published' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
- name: Install dependencies | |
run: npm clean-install | |
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies | |
run: npm audit signatures | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release | |
upload_pypi: | |
needs: [docs] | |
if: github.event_name == 'release' && github.event.action == 'published' | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
merge-multiple: true | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 |