Fix building in C23 (fixes #340) #25
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: Build | |
on: [push, pull_request] | |
jobs: | |
pre-commit: | |
name: Run pre-commit hooks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: astral-sh/setup-uv@v5 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version-file: pyproject.toml | |
- name: Install the project | |
run: uv sync --locked --dev | |
- name: Run pre-commit hooks | |
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd | |
build-wheels: | |
name: Build wheels for ${{ matrix.os }} | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
matrix: | |
include: | |
- os: linux-intel | |
runs-on: ubuntu-latest | |
- os: linux-arm | |
runs-on: ubuntu-24.04-arm | |
- os: windows-intel | |
runs-on: windows-latest | |
- os: macos-intel | |
runs-on: macos-13 | |
- os: macos-arm | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
- name: Get coverage files | |
if: matrix.os == 'linux-intel' | |
id: get-coverage-files | |
run: | | |
FILES=$(find ./wheelhouse -type f -name '.coverage*' -printf '%p ') | |
echo "Found coverage files: $FILES" | |
echo "files=$FILES" >> $GITHUB_OUTPUT | |
- name: Upload to Coveralls | |
if: matrix.os == 'linux-intel' | |
uses: coverallsapp/github-action@v2 | |
with: | |
files: ${{ steps.get-coverage-files.outputs.files }} | |
build-sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
upload-pypi: | |
name: Publish to PyPI | |
needs: [pre-commit, build-wheels, build-sdist] | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 |