Skip to content

Sk runtime effect binding #300

Sk runtime effect binding

Sk runtime effect binding #300

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
prebuild_linux_aarch64_3rd_party:
name: Build skia bundled 3rd-party on linux/aarch64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v4
id: cache-skia
with:
path: |
gn
skia
key: linux-aarch64-skia-${{ github.sha }}-3rd-party
- name: Pre-fetch skia deps
if: ${{ steps.cache-skia.outputs.cache-hit != 'true' }}
run: git config --global core.compression 0 && cd skia && patch -p1 -i ../patch/skia-m131-minimize-download.patch && python tools/git-sync-deps && patch -p1 -R -i ../patch/skia-m131-minimize-download.patch
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build skia 3rd-Party
# Taken from https://github.com/pypa/cibuildwheel/blob/v2.19.2/cibuildwheel/resources/pinned_docker_images.cfg
uses: docker://quay.io/pypa/manylinux2014_aarch64:2024.07.02-0
if: ${{ steps.cache-skia.outputs.cache-hit != 'true' }}
with:
args: bash -c "git config --global --add safe.directory '*' &&
bash scripts/build_Linux.sh &&
chmod a+rwx -R skia"
prebuild_linux_aarch64:
name: Build skia on linux/aarch64
needs: prebuild_linux_aarch64_3rd_party
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v4
id: cache-skia
with:
path: |
gn
skia
key: linux-aarch64-skia-${{ github.sha }}
- uses: actions/cache/restore@v4
with:
path: |
gn
skia
key: linux-aarch64-skia-${{ github.sha }}-3rd-party
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build Skia Proper
uses: docker://quay.io/pypa/manylinux2014_aarch64:2024.07.02-0
with:
args: bash -c "git config --global --add safe.directory '*' &&
bash scripts/build_Linux.sh
build_wheels:
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }}) for ${{ matrix.cp }}
needs: prebuild_linux_aarch64
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022, macos-13]
arch: [auto64]
cp: ["cp3{10,11,12,13}"]
include:
- os: macos-13
arch: arm64
cp: "cp3{10,11,12,13}"
# aarch64 is emulated and takes longer, build one wheel per job
- os: ubuntu-22.04
arch: aarch64
cp: cp310
- os: ubuntu-22.04
arch: aarch64
cp: cp311
- os: ubuntu-22.04
arch: aarch64
cp: cp312
- os: ubuntu-22.04
arch: aarch64
cp: cp313
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache/restore@v4
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
with:
path: |
gn
skia
key: linux-aarch64-skia-${{ github.sha }}
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.arch }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: "${{ matrix.cp }}-*"
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_MACOS: TARGET_ARCH=${{ matrix.arch }} MACOSX_DEPLOYMENT_TARGET=11.0
CIBW_BEFORE_ALL: bash scripts/build_${{ runner.os }}.sh
CIBW_BEFORE_BUILD: pip install pybind11 numpy
CIBW_TEST_REQUIRES: pytest pillow glfw
CIBW_TEST_REQUIRES_MACOS: pytest pillow pyopengl
CIBW_TEST_COMMAND: python -m pytest {project}/tests
CIBW_TEST_COMMAND_LINUX: >
xvfb-run -s "-screen 0 640x480x24" python -m pytest {project}/tests
CIBW_TEST_SKIP: "*-macosx_arm64"
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cp }}
path: ./wheelhouse/*.whl
# identical to "build_wheels", except with the older pypa/cibuildwheel@v2.19.2
build_wheels_old:
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }}) for ${{ matrix.cp }}
needs: prebuild_linux_aarch64
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022, macos-13]
arch: [auto64]
cp: ["cp3{8,9}"]
include:
- os: macos-13
arch: arm64
cp: "cp3{8,9}"
# aarch64 is emulated and takes longer, build one wheel per job
- os: ubuntu-22.04
arch: aarch64
cp: cp38
- os: ubuntu-22.04
arch: aarch64
cp: cp39
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache/restore@v4
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
with:
path: |
gn
skia
key: linux-aarch64-skia-${{ github.sha }}
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.arch }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_BUILD: "${{ matrix.cp }}-*"
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_MACOS: TARGET_ARCH=${{ matrix.arch }} MACOSX_DEPLOYMENT_TARGET=11.0
CIBW_BEFORE_ALL: bash scripts/build_${{ runner.os }}.sh
CIBW_BEFORE_BUILD: pip install pybind11 numpy
CIBW_TEST_REQUIRES: pytest pillow glfw
CIBW_TEST_REQUIRES_MACOS: pytest pillow pyopengl
CIBW_TEST_COMMAND: python -m pytest {project}/tests
CIBW_TEST_COMMAND_LINUX: >
xvfb-run -s "-screen 0 640x480x24" python -m pytest {project}/tests
CIBW_TEST_SKIP: "*-macosx_arm64"
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cp }}
path: ./wheelhouse/*.whl
build_docs:
name: Build docs
needs: [build_wheels, build_wheels_old]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: Build docs
run: |
python -m pip install --pre -f dist skia-python
python -m pip install sphinx==6.2.1 sphinx-rtd-theme
python setup.py build_sphinx
- name: Deploy docs
if: github.event_name == 'release' && github.event.action == 'published'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
publish:
name: Upload packages to PyPI
needs: [build_wheels, build_wheels_old]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/skia-python/
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1