-
Notifications
You must be signed in to change notification settings - Fork 13
170 lines (143 loc) · 4.18 KB
/
test.yml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
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.12",
"3.11",
"3.10",
"3.9",
"3.8",
"3.7",
"2.7",
]
libavif-version: [ "0.11.0" ]
include:
- python-version: "3.9"
os: "ubuntu-20.04"
libavif-version: "1.0.1"
- 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
exclude:
- python-version: "2.7"
os: "macos-11"
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }} (libavif ${{ matrix.libavif-version }})
container:
image: ${{ matrix.python-version == '2.7' && 'python:2.7-buster' || null }}
env:
LIBAVIF_VERSION: ${{ matrix.libavif-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
if: matrix.python-version != '2.7'
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
- 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
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
msys:
runs-on: windows-latest
name: MinGW
defaults:
run:
shell: bash.exe --login -eo pipefail "{0}"
env:
MSYSTEM: MINGW64
CHERE_INVOKING: 1
SETUPTOOLS_USE_DISTUTILS: stdlib
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Set up shell
run: echo "C:\msys64\usr\bin\" >> $env:GITHUB_PATH
shell: pwsh
- name: Install dependencies
run: |
pacman -S --noconfirm \
base-devel \
git \
mingw-w64-x86_64-gcc \
mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-python3-pip \
mingw-w64-x86_64-python3-setuptools \
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-libpng \
mingw-w64-x86_64-openjpeg2 \
mingw-w64-x86_64-zlib \
mingw-w64-x86_64-libavif
- name: Install Dependencies
run: |
python3 -m pip install pytest pytest-cov pillow mock
- name: Build pillow-avif-plugin
run: CFLAGS="-coverage" python3 -m pip install .
- name: Test pillow-avif-plugin
run: |
python3 -m pytest -vx --cov pillow_avif --cov tests --cov-report term --cov-report xml tests
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: GHA_Windows
name: "MSYS2 MinGW"
success:
needs: [build, msys]
runs-on: ubuntu-latest
name: Test Successful
steps:
- name: Success
run: echo Test Successful