Nest _webp under webp #83
This file contains 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 and test packages | |
on: [push] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-sdist: | |
name: Build source distribution | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Build source distribution | |
run: | | |
python -m pip install build | |
python -m build --sdist | |
- name: Upload source distribution | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sdist-${{ github.sha }} | |
path: ./dist/webp-*.tar.gz | |
retention-days: 7 | |
test-sdist: | |
name: Test source distribution | |
needs: build-sdist | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fetch source distribution | |
uses: actions/download-artifact@v3 | |
with: | |
name: sdist-${{ github.sha }} | |
path: dist/ | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install the package | |
run: | | |
python -m pip install dist/webp-*.tar.gz | |
- name: Test with pytest | |
run: | | |
python -m pip install pytest==7.2.1 | |
pytest --import-mode=importlib tests/ | |
build-wheels: | |
name: Build ${{ matrix.cibw_build }} wheels | |
needs: build-sdist | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
cibw_archs: x86_64 | |
cibw_build: "cp38-manylinux_x86_64" | |
compile_target: x86_64 | |
- os: ubuntu-20.04 | |
cibw_archs: x86_64 | |
cibw_build: "cp38-musllinux_x86_64" | |
compile_target: x86_64 | |
- os: ubuntu-20.04 | |
cibw_archs: aarch64 | |
cibw_build: "cp38-manylinux_aarch64" | |
compile_target: armv8 | |
# - os: ubuntu-20.04 | |
# cibw_archs: aarch64 | |
# cibw_build: "cp38-musllinux_aarch64" | |
# compile_target: armv8 | |
# - os: ubuntu-20.04 | |
# cibw_archs: i686 | |
# cibw_build: "cp38-manylinux_i686" | |
# compile_target: x86 | |
# - os: ubuntu-20.04 | |
# cibw_archs: i686 | |
# cibw_build: "cp38-musllinux_i686" | |
# compile_target: x86 | |
# - os: ubuntu-20.04 | |
# cibw_archs: ppc64le | |
# cibw_build: "cp38-manylinux_ppc64le" | |
# compile_target: ppc64le | |
# - os: ubuntu-20.04 | |
# cibw_archs: ppc64le | |
# cibw_build: "cp38-musllinux_ppc64le" | |
# compile_target: ppc64le | |
# - os: ubuntu-20.04 | |
# cibw_archs: s390x | |
# cibw_build: "cp38-manylinux_s390x" | |
# compile_target: s390x | |
# - os: ubuntu-20.04 | |
# cibw_archs: s390x | |
# cibw_build: "cp38-musllinux_s390x" | |
# compile_target: s390x | |
- os: windows-2019 | |
cibw_archs: AMD64 | |
cibw_build: "cp38-win_amd64" | |
compile_target: x86_64 | |
# - os: windows-2019 | |
# cibw_archs: x86 | |
# cibw_build: "cp38-win32" | |
# compile_target: x86 | |
- os: windows-2019 | |
cibw_archs: ARM64 | |
cibw_build: "cp39-win_arm64" | |
compile_target: armv8 | |
# - os: macos-12 | |
# cibw_archs: x86_64 | |
# cibw_build: "cp38-macosx_x86_64" | |
# compile_target: x86_64 | |
# - os: macos-14 | |
# cibw_archs: arm64 | |
# cibw_build: "cp38-macosx_arm64" | |
# compile_target: armv8 | |
- os: macos-14 | |
cibw_archs: universal2 | |
cibw_build: "cp38-macosx_universal2" | |
compile_target: universal2 | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Fetch source distribution | |
uses: actions/download-artifact@v3 | |
with: | |
name: sdist-${{ github.sha }} | |
path: dist/ | |
- run: mv dist/webp-*.tar.gz webp.tar.gz | |
- name: Set up QEMU | |
if: runner.os == 'Linux' && runner.cibw_archs != 'x86_64' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: Build wheels for ${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }} | |
uses: pypa/cibuildwheel@v2.17.0 | |
with: | |
package-dir: webp.tar.gz | |
output-dir: dist | |
env: | |
CIBW_BUILD_FRONTEND: build | |
CIBW_BUILD: ${{ matrix.cibw_build }} | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
CIBW_ENVIRONMENT: PYWEBP_COMPILE_TARGET=${{ matrix.compile_target }} | |
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.8' | |
CIBW_TEST_REQUIRES: pytest | |
CIBW_TEST_COMMAND: pytest --import-mode=importlib {package}/tests | |
- name: abi3audit | |
run: | | |
pip install abi3audit && | |
abi3audit $(ls ./dist/*.whl) --debug --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels-${{ github.sha }} | |
path: ./dist/*.whl | |
retention-days: 7 |