-
Notifications
You must be signed in to change notification settings - Fork 16
266 lines (265 loc) · 8.99 KB
/
ci.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
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
name: CI
on:
pull_request:
push:
workflow_dispatch:
schedule:
# Run at 17:29 every Saturday
- cron: '29 17 * * 6'
jobs:
build-wayland:
name: Build Wayland libraries
runs-on: ubuntu-latest
strategy:
matrix:
wayland-version: ["1.23.0"]
wayland-protocols-version: ["1.36"]
steps:
- name: Setup environment
run: |
echo "CPATH=${HOME}/wayland/usr/include" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${HOME}/wayland/usr/lib" >> $GITHUB_ENV
echo "LIBRARY_PATH=${HOME}/wayland/usr/lib" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=${HOME}/wayland/usr/share/pkgconfig:${HOME}/wayland/usr/lib/pkgconfig" >> $GITHUB_ENV
- name: Install meson
run: |
sudo apt-get install -y --no-install-recommends \
ninja-build
sudo pip install meson
- name: Download and unpack Wayland source
run: |
wget --no-check-certificate $WAYLAND_URL
wget --no-check-certificate $WAYLAND_PROTOCOLS_URL
tar -xJf wayland-${{ matrix.wayland-version }}.tar.xz
tar -xJf wayland-protocols-${{ matrix.wayland-protocols-version }}.tar.xz
env:
WAYLAND_URL: https://gitlab.freedesktop.org/wayland/wayland/-/releases/${{ matrix.wayland-version }}/downloads/wayland-${{ matrix.wayland-version }}.tar.xz
WAYLAND_PROTOCOLS_URL: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/${{ matrix.wayland-protocols-version }}/downloads/wayland-protocols-${{ matrix.wayland-protocols-version }}.tar.xz
- name: Build wayland
working-directory: wayland-${{ matrix.wayland-version }}
run: |
meson build --prefix=/usr -Ddocumentation=false
ninja -C build
DESTDIR=~/wayland ninja -C build install
sudo ninja -C build install
- name: Build wayland-protocols
working-directory: wayland-protocols-${{ matrix.wayland-protocols-version }}
run: |
meson build --prefix=/usr
ninja -C build
DESTDIR=~/wayland ninja -C build install
- name: Create artifact
run: tar czf ~/wayland.tar.gz -C ${HOME}/wayland/ .
- name: Upload built libraries
uses: actions/upload-artifact@v4
with:
name: wayland-${{ matrix.wayland-version }}_${{ matrix.wayland-protocols-version }}
path: ~/wayland.tar.gz
if-no-files-found: error
unit-test:
name: Python ${{ matrix.python-version}} unit tests
runs-on: ubuntu-latest
needs: build-wayland
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
wayland-version: ["1.23.0"]
wayland-protocols-version: ["1.36"]
steps:
- uses: actions/checkout@v4
- name: Download wayland libraries
uses: actions/download-artifact@v4
with:
name: wayland-${{ matrix.wayland-version }}_${{ matrix.wayland-protocols-version }}
- name: Unpack wayland artifact
run: sudo tar xf wayland.tar.gz -C /
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set environment variables
run: |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV
- name: Install Python dependencies
run: |
pip install setuptools
pip install -r requirements.txt
pip install -r requirements-dev.txt
python pywayland/ffi_build.py
python -m pywayland.scanner --with-protocols
- name: Run unit tests
run: pytest --cov pywayland --cov-report term-missing
- name: Push coverage
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coverage:
name: Finalize Coverage
needs: unit-test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
docs-test:
name: Docs check
runs-on: ubuntu-latest
needs: build-wayland
env:
python-version: "3.12"
wayland-version: "1.23.0"
wayland-protocols-version: "1.36"
steps:
- uses: actions/checkout@v4
- name: Download wayland libraries
uses: actions/download-artifact@v4
with:
name: wayland-${{ env.wayland-version }}_${{ env.wayland-protocols-version }}
- name: Unpack wayland artifact
run: sudo tar xf wayland.tar.gz -C /
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Set environment variables
run: |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV
- name: Install Python dependencies
run: |
pip install setuptools
pip install -r requirements.txt
pip install -r doc/requirements.txt
python pywayland/ffi_build.py
python -m pywayland.scanner --with-protocols
- name: Build docs
run: sphinx-build -W -b html doc doc/_build/html
ruff-test:
name: ruff test
runs-on: ubuntu-latest
needs: build-wayland
env:
python-version: "3.12"
wayland-version: "1.23.0"
wayland-protocols-version: "1.36"
steps:
- uses: actions/checkout@v4
- name: Download wayland libraries
uses: actions/download-artifact@v4
with:
name: wayland-${{ env.wayland-version }}_${{ env.wayland-protocols-version }}
- name: Unpack wayland artifact
run: sudo tar xf wayland.tar.gz -C /
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Set environment variables
run: |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV
- name: Install Python dependencies
run: |
pip install setuptools
pip install -r requirements.txt
pip install ruff
python pywayland/ffi_build.py
python -m pywayland.scanner --with-protocols
- name: Run ruff check
uses: chartboost/ruff-action@v1
with:
src: pywayland
mypy-test:
name: mypy test
runs-on: ubuntu-latest
needs: build-wayland
env:
python-version: "3.12"
wayland-version: "1.23.0"
wayland-protocols-version: "1.36"
steps:
- uses: actions/checkout@v4
- name: Download wayland libraries
uses: actions/download-artifact@v4
with:
name: wayland-${{ env.wayland-version }}_${{ env.wayland-protocols-version }}
- name: Unpack wayland artifact
run: sudo tar xf wayland.tar.gz -C /
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Set environment variables
run: |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV
- name: Install Python dependencies
run: |
pip install setuptools
pip install -r requirements.txt
pip install -r requirements-types.txt
python pywayland/ffi_build.py
python -m pywayland.scanner --with-protocols
- name: Run mypy test
run: mypy -p pywayland
packaging-test:
name: Packaging test
runs-on: ubuntu-latest
needs: build-wayland
env:
python-version: "3.12"
wayland-version: "1.23.0"
wayland-protocols-version: "1.36"
steps:
- uses: actions/checkout@v4
- name: Download wayland libraries
uses: actions/download-artifact@v4
with:
name: wayland-${{ env.wayland-version }}_${{ env.wayland-protocols-version }}
- name: Unpack wayland artifact
run: sudo tar xf wayland.tar.gz -C /
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Set environment variables
run: |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV
- name: Install Python dependencies
run: |
pip install setuptools
pip install -r requirements.txt
pip install build check-manifest twine
python pywayland/ffi_build.py
- name: Run packaging test
run: |
check-manifest
python setup.py check -m -s
python -m build --sdist
twine check dist/*
black-test:
name: black test
runs-on: ubuntu-latest
env:
python-version: "3.12"
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Install Python dependencies
run: |
pip install black
- name: Run black test
run: black --check pywayland