-
Notifications
You must be signed in to change notification settings - Fork 86
234 lines (202 loc) · 7 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
name: Test
on:
push:
pull_request:
jobs:
msys2:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- msystem: MINGW64
arch: x86_64
- msystem: MINGW32
arch: i686
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: setup-msys2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
git
mingw-w64-${{ matrix.arch }}-cairo
mingw-w64-${{ matrix.arch }}-python
mingw-w64-${{ matrix.arch }}-python-pip
mingw-w64-${{ matrix.arch }}-cc
mingw-w64-${{ matrix.arch }}-meson
mingw-w64-${{ matrix.arch }}-ninja
mingw-w64-${{ matrix.arch }}-pkg-config
- name: Install dependencies
shell: msys2 {0}
run: |
python -m pip install pytest coverage hypothesis setuptools wheel
- name: Build & Test with setuptools
shell: msys2 {0}
run: |
export SETUPTOOLS_USE_DISTUTILS=stdlib
export CFLAGS="-std=c90 -Wall -Wno-long-long -Werror -coverage"
python -m coverage run --branch setup.py test
python -m coverage xml -i
python setup.py sdist
python setup.py bdist_wheel
python setup.py install --root="$(pwd)"/_root_abs
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Build & Install with pip
shell: msys2 {0}
run: |
git clean -xfdf
export SETUPTOOLS_USE_DISTUTILS=stdlib
python -m pip install .
- name: Build & Test with meson
shell: msys2 {0}
run: |
git clean -xfdf
meson --werror _build
meson compile -C _build
meson test -v -C _build
ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y libcairo2-dev ninja-build
python -m pip install --upgrade setuptools
python -m pip install --upgrade pytest flake8 coverage hypothesis wheel poetry meson
python -m pip install --upgrade pygame || true
- name: Build & Test with setuptools
run: |
export CFLAGS="-Werror -coverage"
python -m coverage run --branch setup.py test
python -m coverage xml -i
python setup.py sdist
python setup.py bdist_wheel
python setup.py install --root="$(pwd)"/_root_abs
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Build & Install with pip
run: |
git clean -xfdf
python -m pip install .
- name: Build & Test with meson
run: |
git clean -xfdf
meson --werror _build
meson compile -C _build
meson test -v -C _build
- name: Build & Test with poetry
if: ${{ matrix.python-version != 'pypy-3.8' }}
run: |
git clean -xfdf
poetry install
poetry run python setup.py test
- name: Run linters
if: ${{ matrix.python-version != 'pypy-3.8' }}
run: |
poetry run flake8
poetry run mypy .
- name: Build docs
if: ${{ matrix.python-version != 'pypy-3.8' }}
run: |
poetry run python -m sphinx -W -a -E -b html -n docs docs/_build
msvc:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
architecture: ['x86', 'x64']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
allow-prereleases: true
- name: Download and extract Cairo Binary
run: |
python .ci/download-cairo-win32.py
- name: Build
env:
PKG_CONFIG: ${{ github.workspace }}/cairo-prebuild/bin/pkgconf.exe
PKG_CONFIG_PATH: ${{ github.workspace }}/cairo-prebuild/lib/pkgconfig
run: |
python -m pip install --upgrade pip
if (-not $?) { exit 1 }
python -m pip install --upgrade wheel
if (-not $?) { exit 1 }
python -m pip install --upgrade setuptools
if (-not $?) { exit 1 }
python -m pip install --upgrade pytest flake8 coverage hypothesis
if (-not $?) { exit 1 }
python -m pip install --upgrade pygame
python -m coverage run --branch setup.py test
if (-not $?) { exit 1 }
python -m coverage xml -i
if (-not $?) { exit 1 }
python -m flake8 .
if (-not $?) { exit 1 }
python setup.py sdist
if (-not $?) { exit 1 }
python setup.py bdist
if (-not $?) { exit 1 }
python setup.py install --root=_root
if (-not $?) { exit 1 }
python setup.py bdist_wheel
if (-not $?) { exit 1 }
python setup.py install --root=_root_setup
if (-not $?) { exit 1 }
python -m pip install .
if (-not $?) { exit 1 }
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.python-version }}
path: dist/pycairo*.whl
macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
brew install pkg-config cairo python meson
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade pytest coverage hypothesis wheel
- name: Build & Test with setuptools
run: |
python3 -m coverage run --branch setup.py test
python3 -m coverage xml -i
python3 setup.py sdist
python3 setup.py install --root="$(pwd)"/_root_abs
python3 setup.py bdist_wheel
python3 -m pip install .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Build & Install with pip
run: |
git clean -xfdf
python3 -m pip install .
- name: Build & Test with meson
run: |
git clean -xfdf
meson --werror _build
meson compile -C _build
meson test -v -C _build