-
Notifications
You must be signed in to change notification settings - Fork 43
296 lines (252 loc) · 9.08 KB
/
ci.yml
File metadata and controls
296 lines (252 loc) · 9.08 KB
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
name: CI
on:
push:
branches:
- master
tags-ignore:
- "v*"
pull_request:
branches:
- master
jobs:
editable-linux:
name: Editable Linux (Python ${{ matrix.python-version }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.12"
env:
ALSOFT_DRIVERS: "null"
SFML_VERSION: 3.0.2
SFML_INSTALL_PREFIX: ${{ github.workspace }}/.deps/sfml-3.0.2-install
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
git \
libflac-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libudev-dev \
libvorbis-dev \
libx11-dev \
libxcursor-dev \
libxi-dev \
libxrandr-dev \
ninja-build \
pkg-config \
xvfb
- name: Build SFML 3.0.2
run: bash .github/scripts/build-sfml-unix.sh "$SFML_VERSION" "$SFML_INSTALL_PREFIX"
- name: Install Python tooling
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
- name: Run pytest suite from editable install under Xvfb
env:
SFML_HEADERS: ${{ env.SFML_INSTALL_PREFIX }}/include
SFML_LIBRARIES: ${{ env.SFML_INSTALL_PREFIX }}/lib
PKG_CONFIG_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib/pkgconfig
LD_LIBRARY_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib
run: xvfb-run -a pytest -q tests --ignore=tests/test_window_xvfb.py --ignore=tests/test_graphics_xvfb.py
- name: Run Xvfb-backed window and graphics tests
if: matrix.python-version == '3.12'
env:
SFML_HEADERS: ${{ env.SFML_INSTALL_PREFIX }}/include
SFML_LIBRARIES: ${{ env.SFML_INSTALL_PREFIX }}/lib
PKG_CONFIG_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib/pkgconfig
LD_LIBRARY_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib
run: xvfb-run -a pytest -q tests/test_window_xvfb.py tests/test_graphics_xvfb.py
packaging-validation-linux:
name: Packaging Validation Linux
runs-on: ubuntu-24.04
env:
ALSOFT_DRIVERS: "null"
SFML_VERSION: 3.0.2
SFML_INSTALL_PREFIX: ${{ github.workspace }}/.deps/sfml-3.0.2-install
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
git \
libflac-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libudev-dev \
libvorbis-dev \
libx11-dev \
libxcursor-dev \
libxi-dev \
libxrandr-dev \
ninja-build \
pkg-config
- name: Build SFML 3.0.2
run: bash .github/scripts/build-sfml-unix.sh "$SFML_VERSION" "$SFML_INSTALL_PREFIX"
- name: Install packaging tools
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build sdist and wheel
env:
SFML_HEADERS: ${{ env.SFML_INSTALL_PREFIX }}/include
SFML_LIBRARIES: ${{ env.SFML_INSTALL_PREFIX }}/lib
PKG_CONFIG_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib/pkgconfig
LD_LIBRARY_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib
run: python -m build --sdist --wheel
- name: Validate artifact contents and metadata
run: |
python .github/scripts/validate-dist.py dist/*
python -m twine check dist/*
- name: Install built wheel in a clean environment
env:
LD_LIBRARY_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib
run: |
python -m venv .venv-wheel
. .venv-wheel/bin/activate
python -m pip install --upgrade pip
python -m pip install dist/*.whl "pytest>=8"
pytest -q tests/test_smoke_imports.py tests/test_typing_artifacts.py
- name: Install built sdist in a clean environment
env:
SFML_HEADERS: ${{ env.SFML_INSTALL_PREFIX }}/include
SFML_LIBRARIES: ${{ env.SFML_INSTALL_PREFIX }}/lib
PKG_CONFIG_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib/pkgconfig
LD_LIBRARY_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib
run: |
python -m venv .venv-sdist
. .venv-sdist/bin/activate
python -m pip install --upgrade pip
python -m pip install dist/*.tar.gz "pytest>=8"
pytest -q tests/test_smoke_imports.py tests/test_typing_artifacts.py
smoke-macos:
name: Smoke macOS
runs-on: macos-15
env:
ALSOFT_DRIVERS: "null"
SFML_VERSION: 3.0.2
SFML_INSTALL_PREFIX: ${{ github.workspace }}/.deps/sfml-3.0.2-install
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build SFML 3.0.2
run: bash .github/scripts/build-sfml-unix.sh "$SFML_VERSION" "$SFML_INSTALL_PREFIX" 1
- name: Install package and pytest
env:
SFML_HEADERS: ${{ env.SFML_INSTALL_PREFIX }}/include
SFML_LIBRARIES: ${{ env.SFML_INSTALL_PREFIX }}/lib
PKG_CONFIG_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib/pkgconfig
DYLD_LIBRARY_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
- name: Run smoke imports and typing-artifact checks
env:
DYLD_LIBRARY_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib
run: pytest -q tests/test_smoke_imports.py tests/test_typing_artifacts.py
smoke-windows:
name: Smoke Windows
runs-on: windows-2022
env:
SFML_VERSION: 3.0.2
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build SFML 3.0.2
shell: pwsh
run: |
$prefix = Join-Path $env:GITHUB_WORKSPACE '.deps\sfml-3.0.2-install'
"SFML_INSTALL_PREFIX=$prefix" >> $env:GITHUB_ENV
"SFML_HEADERS=$(Join-Path $prefix 'include')" >> $env:GITHUB_ENV
"SFML_LIBRARIES=$(Join-Path $prefix 'lib')" >> $env:GITHUB_ENV
.github/scripts/build-sfml-windows.ps1 -Version $env:SFML_VERSION -Prefix $prefix -Architecture x64
- name: Verify SFML headers are present
shell: pwsh
run: |
$configHeader = Join-Path $env:SFML_HEADERS 'SFML\Config.hpp'
if (-not (Test-Path $configHeader)) {
throw "Expected SFML header not found: $configHeader"
}
Get-Item $configHeader
- name: Install package and pytest
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
- name: Run smoke imports and typing-artifact checks
shell: pwsh
run: |
$env:PATH = "$(Join-Path $env:SFML_INSTALL_PREFIX 'bin');$env:PATH"
pytest -q tests/test_smoke_imports.py tests/test_typing_artifacts.py
typing-linux:
name: Typing Validation Linux
runs-on: ubuntu-24.04
env:
SFML_VERSION: 3.0.2
SFML_INSTALL_PREFIX: ${{ github.workspace }}/.deps/sfml-3.0.2-install
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
git \
libflac-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libudev-dev \
libvorbis-dev \
libx11-dev \
libxcursor-dev \
libxi-dev \
libxrandr-dev \
ninja-build \
pkg-config
- name: Build SFML 3.0.2
run: bash .github/scripts/build-sfml-unix.sh "$SFML_VERSION" "$SFML_INSTALL_PREFIX"
- name: Install package and mypy
env:
SFML_HEADERS: ${{ env.SFML_INSTALL_PREFIX }}/include
SFML_LIBRARIES: ${{ env.SFML_INSTALL_PREFIX }}/lib
PKG_CONFIG_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib/pkgconfig
LD_LIBRARY_PATH: ${{ env.SFML_INSTALL_PREFIX }}/lib
run: |
python -m pip install --upgrade pip
python -m pip install -e . "mypy>=1.11"
- name: Run curated typing check
run: python -m mypy --python-version 3.10 tests/typing/public_api_usage.py