1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12", "3.14"]
steps:
- uses: actions/checkout@v6
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: ${{ matrix.python-version }}
environment-file: ci/environment.yaml
activate-environment: test-environment
channels: conda-forge
conda-remove-defaults: true
channel-priority: strict
- name: Run tests
shell: bash -l {0}
run: |
pip install -e .
python selftest.py
build:
name: "Build wheels on ${{ matrix.os }} ${{ matrix.cibw_archs }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
cibw_archs: "AMD64"
- os: windows-11-arm
cibw_archs: "ARM64"
- os: macos-15-intel
cibw_archs: "x86_64"
- os: macos-14 # The macos-14 runner is arm64, while up until macos-13 the runners are x86_64.
cibw_archs: "arm64"
- os: "ubuntu-24.04-arm"
cibw_archs: "aarch64"
- os: "ubuntu-22.04"
cibw_archs: "x86_64"
steps:
- uses: actions/checkout@v6
# See discussion here: https://github.com/actions/runner-images/issues/9256
- name: Make sure pipx is installed for the arm64 macOS runners.
if: runner.os == 'macOS' && runner.arch == 'ARM64'
run: |
brew install pipx
pipx ensurepath
- name: Build wheels
uses: pypa/cibuildwheel@v3.3.0
env:
CIBW_TEST_COMMAND: python {project}/selftest.py
CIBW_BEFORE_BUILD_LINUX: yum install -y freetype-devel
CIBW_SKIP: "cp39-* cp310-* *-win32 *i686 *-musllinux*"
CIBW_TEST_REQUIRES: numpy pillow pytest
CIBW_TEST_SKIP: "*-win_arm64"
CIBW_ARCHS: "${{ matrix.cibw_archs }}"
# disable finding unintended freetype installations
CIBW_ENVIRONMENT_WINDOWS: "AGGDRAW_FREETYPE_ROOT=''"
# we use libpng/libfreetype from homebrew which has a current limit of
# macos 14
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=14
- name: upload
uses: actions/upload-artifact@v5
with:
name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}
path: "./wheelhouse/*.whl"
publish:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: sdist
run: |
python -m pip install -U build pip
python -m build -s
- name: download
uses: actions/download-artifact@v6
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
skip-existing: true
|