Skip to content

Merge pull request #210 from HinTak/m120-public #1

Merge pull request #210 from HinTak/m120-public

Merge pull request #210 from HinTak/m120-public #1

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@v3
with:
submodules: true
- uses: actions/cache@v3
id: cache-skia
with:
path: |
gn
skia
key: linux-aarch64-skia-${{ github.sha }}-3rd-party
- name: Pre-fetch skia deps
run: git config --global core.compression 0 && cd skia && patch -p1 -i ../patch/skia-m120-minimize-download.patch && python tools/git-sync-deps && patch -p1 -R -i ../patch/skia-m120-minimize-download.patch
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Build skia 3rd-Party
# Taken from https://github.com/pypa/cibuildwheel/blob/v2.16.2/cibuildwheel/resources/pinned_docker_images.cfg
uses: docker://quay.io/pypa/manylinux2014_aarch64:2023-10-03-72cdc42
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@v3
with:
submodules: true
- uses: actions/cache@v3
id: cache-skia
with:
path: |
gn
skia
key: linux-aarch64-skia-${{ github.sha }}
- uses: actions/cache/restore@v3
with:
path: |
gn
skia
key: linux-aarch64-skia-${{ github.sha }}-3rd-party
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Build Skia Proper
uses: docker://quay.io/pypa/manylinux2014_aarch64:2023-10-03-72cdc42
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-12]
arch: [auto64]
cp: ["cp3{7,8,9,10,11,12}"]
include:
- os: macos-12
arch: arm64
cp: "cp3{7,8,9,10,11,12}"
# aarch64 is emulated and takes longer, build one wheel per job
- os: ubuntu-22.04
arch: aarch64
cp: cp37
- os: ubuntu-22.04
arch: aarch64
cp: cp38
- os: ubuntu-22.04
arch: aarch64
cp: cp39
- os: ubuntu-22.04
arch: aarch64
cp: cp310
- os: ubuntu-22.04
arch: aarch64
cp: cp311
- os: ubuntu-22.04
arch: aarch64
cp: cp312
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/cache/restore@v3
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@v2
with:
platforms: ${{ matrix.arch }}
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "${{ matrix.cp }}-*"
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_MACOS: TARGET_ARCH=${{ matrix.arch }}
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@v3
with:
path: ./wheelhouse/*.whl
build_docs:
name: Build docs
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
- uses: actions/download-artifact@v3
with:
name: artifact
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]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}