-
Notifications
You must be signed in to change notification settings - Fork 13
165 lines (137 loc) · 4.16 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
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