Repository navigation
267 lines (244 loc) · 8.74 KB
/
Copy pathci.yml
File metadata and controls
267 lines (244 loc) · 8.74 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
---
name: CI
permissions: {}
on:
pull_request:
push:
branches:
- master
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
PYTHON_VERSION: '3.14'
jobs:
setup_release:
name: Setup Release
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
publish_release: ${{ steps.setup_release.outputs.publish_release }}
release_body: ${{ steps.setup_release.outputs.release_body }}
release_commit: ${{ steps.setup_release.outputs.release_commit }}
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
release_tag: ${{ steps.setup_release.outputs.release_tag }}
release_version: ${{ steps.setup_release.outputs.release_version }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Release
id: setup_release
uses: LizardByte/actions/actions/release_setup@81873587bacc6842098865a35bbb32f2f21cee3b # v2026.1123.33249
with:
dotnet: true
github_token: ${{ secrets.GITHUB_TOKEN }}
test:
name: Test (${{ matrix.name }})
permissions:
contents: read
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux-GCC
os: ubuntu-latest
shell: bash
cmake_flags: -G Ninja
coverage: true
- name: Windows-UCRT64
os: windows-latest
shell: msys2 {0}
cmake_flags: -G Ninja
coverage: true
- name: Windows-MSVC
os: windows-2025-vs2026
shell: pwsh
cmake_flags: -G "Visual Studio 18 2026" -A x64
coverage: false
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: recursive
- name: Install Linux DRM headers
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends --yes libdrm-dev
- name: Set up UCRT64
if: matrix.name == 'Windows-UCRT64'
uses: msys2/setup-msys2@3c51bf698df1e37b2261f53cb67797b97761185c # v2.34.0
with:
msystem: ucrt64
update: true
install: >-
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-ninja
- name: Configure tests
run: >-
cmake -S . -B cmake-build-ci
-DBUILD_TESTS=ON
${{ matrix.cmake_flags }}
- name: Build tests
run: cmake --build cmake-build-ci --config Release --parallel
- name: Set up Python
if: matrix.coverage
id: setup-python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up uv
if: matrix.coverage
uses: astral-sh/setup-uv@36300bab3f61b84e19f32b6bd26b7897f3c7e951 # v10.4.2
with:
enable-cache: true
cache-dependency-glob: third-party/lizardbyte-common/uv.lock
- name: Run tests
id: tests
working-directory: cmake-build-ci
run: ctest -C Release --output-on-failure --output-junit junit.xml --parallel 4
- name: Generate coverage report
if: >-
!cancelled() && matrix.coverage &&
(steps.tests.outcome == 'success' || steps.tests.outcome == 'failure')
env:
MSYS2_PATH_TYPE: inherit
UV_PYTHON: ${{ steps.setup-python.outputs.python-path }}
run: |
uv sync --project third-party/lizardbyte-common --locked --only-group test-c \
--no-python-downloads \
--no-install-project
uv run --project third-party/lizardbyte-common --locked --no-sync gcovr cmake-build-ci \
--root . \
--filter '^src/driver/' \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--cobertura-pretty \
--output cmake-build-ci/coverage.xml
- name: Upload reports
if: >-
!cancelled() &&
(steps.tests.outcome == 'success' || steps.tests.outcome == 'failure')
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: reports-${{ matrix.name }}
path: |
cmake-build-ci/junit.xml
cmake-build-ci/coverage.xml
if-no-files-found: error
codecov:
name: Codecov (${{ matrix.name }})
if: github.repository_owner == 'LizardByte'
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: Linux-GCC
coverage: true
- name: Windows-UCRT64
coverage: true
- name: Windows-MSVC
coverage: false
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download reports
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: reports-${{ matrix.name }}
path: _reports
- name: Upload coverage
if: matrix.coverage
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
disable_search: true
fail_ci_if_error: true
files: ./_reports/coverage.xml
flags: ${{ matrix.name }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
disable_search: true
fail_ci_if_error: true
files: ./_reports/junit.xml
flags: ${{ matrix.name }}
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
windows_driver:
name: Windows Driver
needs: setup_release
permissions:
contents: read
uses: ./.github/workflows/ci-driver.yml
with:
azure_signing_account: ${{ vars.AZURE_SIGNING_ACCOUNT }}
azure_signing_cert_profile: ${{ vars.AZURE_SIGNING_CERT_PROFILE }}
azure_signing_endpoint: ${{ vars.AZURE_SIGNING_ENDPOINT }}
publish_release: ${{ needs.setup_release.outputs.publish_release }}
release_commit: ${{ needs.setup_release.outputs.release_commit }}
release_version: ${{ needs.setup_release.outputs.release_version }}
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
release:
name: Release
if: >-
github.repository_owner == 'LizardByte' &&
needs.setup_release.outputs.publish_release == 'true'
needs:
- setup_release
- test
- windows_driver
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Download Windows package
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: windows-driver-package
path: artifacts
- name: Validate release metadata
env:
RELEASE_COMMIT: ${{ needs.setup_release.outputs.release_commit }}
RELEASE_TAG: ${{ needs.setup_release.outputs.release_tag }}
RELEASE_VERSION: ${{ needs.setup_release.outputs.release_version }}
run: |
test -n "${RELEASE_TAG}"
test -n "${RELEASE_VERSION}"
test "${RELEASE_COMMIT}" = "${GITHUB_SHA}"
shopt -s dotglob nullglob
release_assets=(*artifacts/*)
test "${#release_assets[@]}" -eq 1
test "${release_assets[0]}" = artifacts/libvirtualdisplay-Windows-AMD64-driver.zip
test -s artifacts/libvirtualdisplay-Windows-AMD64-driver.zip
- name: Create draft GitHub release
uses: LizardByte/actions/actions/release_create@81873587bacc6842098865a35bbb32f2f21cee3b # v2026.1123.33249
with:
allowUpdates: false
artifactErrorsFailBuild: true
body: ${{ needs.setup_release.outputs.release_body }}
draft: true
generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }}
name: ${{ needs.setup_release.outputs.release_tag }}
prerelease: true
tag: ${{ needs.setup_release.outputs.release_tag }}
token: ${{ secrets.GH_BOT_TOKEN }}