Skip to content

overhaul github actions, h/t @matplotlib #1

overhaul github actions, h/t @matplotlib

overhaul github actions, h/t @matplotlib #1

Workflow file for this run

name: Build wheels
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
outputs:
SDIST_NAME: ${{ steps.sdist.outputs.SDIST_NAME }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with :
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install test dependencies
run: |
python -m pip install build twine flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 SuchTree --count --ignore=E201,E202,E203 \
--select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 SuchTree --count --ignore=E201,E202,E203 \
--exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: pytest
- name: Build source distribution
id: sdist
run: |
python -m build --sdist
python -m .github/export_sdist_name.py
- name: Upload sdist result
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
if-no-files-found: error
build_wheels:
name: Build wheels on ${{ matrix.os }} for python ${{ matrix.python-version }}
needs: build_sdist
runs-on: ${{ matrix.os }}
env:
CIBW_BEFORE_BUILD: >-
rm -rf {package}/build
CIBW_BEFORE_BUILD_WINDOWS: >-
pip install delvewheel &&
rm -rf {package}/build
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair -w {dest_dir} {wheel}
CIBW_AFTER_BUILD: >-
twine check {wheel}
CIBW_TEST_COMMAND: >-
python {package}/.github/check_version_number.py
strategy:
matrix:
include:
- os: ubuntu-latest
cibw_archs: "x86_64"
- os: ubuntu-latest
cibw_archs: "aarch64"
- os: windows-latest
cibw_archs: "auto64"
- os: macos-latest
cibw_archs: "x86_64"
- os: macos-latest
cibw_archs: "arm64"
exclude:
- os: macos-latest

Check failure on line 78 in .github/workflows/package.yml

View workflow run for this annotation

GitHub Actions / Build wheels

Invalid workflow file

The workflow is not valid. .github/workflows/package.yml (Line: 78, Col: 13): Matrix exclude key 'os' does not match any key within the matrix .github/workflows/package.yml (Line: 79, Col: 13): Matrix exclude key 'python-version' does not match any key within the matrix
python-version: "3.12"
steps:
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: cibw-sdist
path: dist/
- name: Build wheels for CPython 3.12
uses: pypa/[email protected]
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp312-*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
- name: Build wheels for CPython 3.11
uses: pypa/[email protected]
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp311-*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
- name: Build wheels for CPython 3.10
uses: pypa/[email protected]
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp310-*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
merge:
runs-on: ubuntu-latest
needs: build_wheels
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: wheelhouse
pattern: cibw-wheels-*