-
Notifications
You must be signed in to change notification settings - Fork 19
213 lines (212 loc) · 7.3 KB
/
ci.yml
File metadata and controls
213 lines (212 loc) · 7.3 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
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-24.04
strategy:
fail-fast: false
matrix:
wayland-version: ["1.24.0"]
wayland-protocols-version: ["1.45"]
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 setup 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 setup 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-24.04
needs: build-wayland
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "pypy-3.11"
wayland-version: ["1.24.0"]
wayland-protocols-version: ["1.45"]
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 .[ci]
python pywayland/ffi_build.py
python -m pywayland.scanner --with-protocols
- name: Run unit tests
run: |
pip install .[test]
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-24.04
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-24.04
needs: build-wayland
env:
python-version: "3.14"
wayland-version: "1.24.0"
wayland-protocols-version: "1.45"
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 .[ci]
python pywayland/ffi_build.py
python -m pywayland.scanner --with-protocols
- name: Build docs
run: |
pip install .[docs]
sphinx-build -W -b html doc doc/_build/html
pre-commit-test:
name: pre-commit test
runs-on: ubuntu-24.04
needs: build-wayland
env:
python-version: "3.14"
wayland-version: "1.24.0"
wayland-protocols-version: "1.45"
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 .[ci]
python pywayland/ffi_build.py
python -m pywayland.scanner --with-protocols
- name: Run pre-commit test
uses: pre-commit/action@v3.0.1
packaging-test:
name: packaging test
runs-on: ubuntu-24.04
needs: build-wayland
env:
python-version: "3.14"
wayland-version: "1.24.0"
wayland-protocols-version: "1.45"
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 .[ci]
python pywayland/ffi_build.py
python -m pywayland.scanner --with-protocols
- name: Run packaging test
run: |
pip install .[packaging]
check-manifest
python setup.py check -m -s
python -m build --sdist
twine check dist/*