Skip to content

fixup

fixup #260

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [
"ubuntu-20.04",
"macos-11",
]
python-version: [
"pypy-3.7",
"3.10",
"3.9",
"3.8",
"3.7",
]
include:
- python-version: "3.7"
PYTHONOPTIMIZE: 1
- python-version: "3.8"
PYTHONOPTIMIZE: 2
# Include new variables for Codecov
- os: ubuntu-20.04
codecov-flag: GHA_Ubuntu
- os: macos-11
codecov-flag: GHA_macOS
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
env:
LIBAVIF_VERSION: 0.11.0
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache build
id: build-cache
uses: actions/cache@v3
with:
path: depends/libavif-${{ env.LIBAVIF_VERSION }}
key:
${{ env.LIBAVIF_VERSION }}-${{ hashFiles('.github/workflows/*.sh', '.github/workflows/test.yml', 'depends/*') }}-${{ matrix.os }}
- name: Install nasm
if: steps.build-cache.outputs.cache-hit != 'true'
uses: ilammy/setup-nasm@v1
with:
version: 2.15.05
- name: Install dependencies
run: |
.github/workflows/install.sh
env:
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
- name: Test
run: |
tox
env:
PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }}
- name: Prepare to upload errors
if: failure()
run: |
mkdir -p tests/errors
shell: pwsh
- name: Upload errors
uses: actions/upload-artifact@v3
if: failure()
with:
name: errors
path: tests/errors
- name: Combine coverage
run: tox -e coverage-report
env:
CODECOV_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }}
- name: Upload coverage
run: tox -e codecov -- -F ${{ matrix.codecov-flag }}
env:
CODECOV_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }}
msys:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
msystem: [ "mingw64" ]
python-version: ["3"]
include:
- msystem: "mingw64"
name: "MSYS2 MinGW 64-bit"
package: "mingw-w64-x86_64"
env: x86_64
name: ${{ matrix.name }} python ${{ matrix.python-version }}
defaults:
run:
shell: msys2 {0}
env:
MSYSTEM: ${{ matrix.msystem }}
CHERE_INVOKING: 1
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
base-devel
git
${{ matrix.package }}-toolchain
${{ matrix.package }}-python${{ matrix.python-version }}-pip
${{ matrix.package }}-python${{ matrix.python-version }}-setuptools
${{ matrix.package }}-libjpeg-turbo
${{ matrix.package }}-libtiff
${{ matrix.package }}-libpng
${{ matrix.package }}-openjpeg2
${{ matrix.package }}-libavif
- name: Install Dependencies
run: |
python${{ matrix.python-version }} -m pip install pytest pytest-cov pillow mock
- name: Build pillow-avif-plugin
run: SETUPTOOLS_USE_DISTUTILS="stdlib" CFLAGS="-coverage" python${{ matrix.python-version }} -m pip install .
- name: Test pillow-avif-plugin
run: |
python${{ matrix.python-version }} -m pytest -vx --cov pillow_avif --cov tests --cov-report term --cov-report xml tests
- name: Upload coverage
run: |
python${{ matrix.python-version }} -m pip install codecov
bash <(curl -s https://codecov.io/bash) -F GHA_Windows
env:
CODECOV_NAME: ${{ matrix.name }}
success:
needs: [build, msys]
runs-on: ubuntu-20.04
name: Test Successful
steps:
- name: Success
run: echo Test Successful