Repository navigation
248 lines (216 loc) · 8.53 KB
/
Copy pathci-linux.yml
File metadata and controls
248 lines (216 loc) · 8.53 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
---
name: CI-Linux
permissions: {}
on:
workflow_call:
inputs:
release_commit:
required: true
type: string
release_version:
required: true
type: string
env:
PYTHON_VERSION: '3.14'
jobs:
build_linux:
name: ${{ matrix.name }}
env:
APP_ID: dev.lizardbyte.app.Sunshine
M_ARCH: ${{ matrix.arch }}
VERSION: ${{ inputs.release_version }}
permissions:
contents: read
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: AppImage-aarch64
EXTRA_ARGS: '--appimage-build'
arch: aarch64
runner: ubuntu-22.04-arm
- name: AppImage-x86_64
EXTRA_ARGS: '--appimage-build'
arch: x86_64
runner: ubuntu-22.04
steps:
- name: More space
uses: LizardByte/actions/actions/more_space@0528b495e6af82b4d698ec6c907a9b1842622068 # v2026.1029.234422
with:
analyze-space-savings: true
clean-all: true
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Setup Dependencies Linux
timeout-minutes: 5
run: |
# create the artifacts directory
mkdir -p artifacts
# allow libfuse2 for appimage on 22.04+
sudo add-apt-repository universe
sudo apt-get install -y \
libdrm-dev \
libfuse2 \
libgl-dev \
libwayland-dev \
libx11-xcb-dev \
libxcb-dri3-dev \
libxfixes-dev \
libxtst-dev
- name: Build Linux
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_VERSION: ${{ inputs.release_version }}
COMMIT: ${{ inputs.release_commit }}
run: |
chmod +x ./scripts/linux_build.sh
echo "::add-matcher::.github/matchers/gcc.json"
./scripts/linux_build.sh \
--publisher-name="LizardByte" \
--publisher-website="https://app.lizardbyte.dev" \
--publisher-issue-url="https://app.lizardbyte.dev/support" \
--skip-cleanup \
--skip-package \
--ubuntu-test-repo ${{ matrix.EXTRA_ARGS }}
echo "::remove-matcher owner=gcc::"
- name: Package Linux - AppImage
if: startsWith(matrix.name, 'AppImage')
working-directory: build
run: |
# install sunshine to the DESTDIR
DESTDIR=AppDir ninja install
test -f AppDir/usr/share/sunshine/udev/rules.d/60-sunshine.rules
grep -Fq 'IMPORT{parent}="HID_*"' \
AppDir/usr/share/sunshine/udev/rules.d/60-sunshine.rules
grep -Fq 'ENV{HID_PHYS}=="libvirtualhid/uhid/*"' \
AppDir/usr/share/sunshine/udev/rules.d/60-sunshine.rules
# custom AppRun file
cp -f ../packaging/linux/AppImage/AppRun ./AppDir/
chmod +x ./AppDir/AppRun
# variables
DESKTOP_FILE="${DESKTOP_FILE:-${APP_ID}.desktop}"
ICON_FILE="${ICON_FILE:-sunshine.png}"
LINUXDEPLOY_GH="https://github.com/linuxdeploy/linuxdeploy"
# AppImage
# https://docs.appimage.org/packaging-guide/index.html
url="${LINUXDEPLOY_GH}/releases/download/continuous/linuxdeploy-${M_ARCH}.AppImage"
wget --max-redirect=1 -q "$url" # NOSONAR(githubactions:S6506): GitHub release needs one redirect.
chmod +x "linuxdeploy-${M_ARCH}.AppImage"
# https://github.com/linuxdeploy/linuxdeploy-plugin-qt
url="${LINUXDEPLOY_GH}-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${M_ARCH}.AppImage"
wget --max-redirect=1 -q "$url" # NOSONAR(githubactions:S6506): GitHub release needs one redirect.
chmod +x "linuxdeploy-plugin-qt-${M_ARCH}.AppImage"
export QMAKE=/usr/lib/qt6/bin/qmake
export EXTRA_QT_MODULES="svg;"
"$QMAKE" -query QT_INSTALL_PLUGINS
"./linuxdeploy-${M_ARCH}.AppImage" \
--appdir ./AppDir \
--plugin qt \
--executable ./sunshine \
--exclude-library 'libva.so*' \
--exclude-library 'libva-*.so*' \
--icon-file "../$ICON_FILE" \
--desktop-file "./$DESKTOP_FILE" \
--output appimage
# Keep the host's libva core, backends, and driver configuration together.
readelf -d ./sunshine | grep -F 'Shared library: [libva.so.2]'
readelf -d ./sunshine | grep -F 'Shared library: [libva-drm.so.2]'
test -z "$(find ./AppDir \( -name 'libva.so*' -o -name 'libva-*.so*' \) -print -quit)"
# print original name of AppImage file
echo "AppImage file: $(ls Sunshine*.AppImage)"
# move
mv Sunshine*.AppImage "../artifacts/Sunshine_${VERSION}_${M_ARCH}.AppImage"
# permissions
chmod +x "../artifacts/Sunshine_${VERSION}_${M_ARCH}.AppImage"
- name: Delete CUDA
# free up space on the runner
run: |
rm -rf ./build/cuda
- name: Setup python
id: python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Verify AppImage
if: startsWith(matrix.name, 'AppImage')
run: |
# TODO: switch to upstream after
# https://github.com/TheAssassin/appimagelint/pull/50 and
# https://github.com/TheAssassin/appimagelint/pull/51
APPIMAGELINT_REPOSITORY="git+https://github.com/ReenigneArcher/appimagelint.git"
APPIMAGELINT_REF="lizardbyte"
python -m pip install -e "${APPIMAGELINT_REPOSITORY}@${APPIMAGELINT_REF}#egg=appimagelint"
appimagelint --help
appimagelint "./artifacts/Sunshine_${VERSION}_${M_ARCH}.AppImage"
- name: Install screenshot dependency
run: |
sudo apt-get update -y
sudo apt-get install -y imagemagick
# clean apt cache
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
- name: Setup virtual desktop
uses: LizardByte/actions/actions/virtual_desktop@0528b495e6af82b4d698ec6c907a9b1842622068 # v2026.1029.234422
- name: Setup uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
enable-cache: true
- name: Sync Python tools
run: |
uv_sync_args=(
--locked
--python "${PYTHON_VERSION}"
--no-python-downloads
--no-install-project
)
# uv.lock pins external artifacts; reviewed local build hooks are required for gcovr.
uv sync "${uv_sync_args[@]}" # NOSONAR(githubactions:S8541)
- name: Run tests
id: test
working-directory: build/tests
run: ./test_sunshine --gtest_color=yes --gtest_output=xml:test_results.xml
- name: Upload system tray screenshots
if: >-
always() &&
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: sunshine-screenshots-${{ matrix.name }}
path: build/tests/screenshots
if-no-files-found: error
- name: Generate gcov report
id: test_report
# any except canceled or skipped
if: >-
always() &&
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
working-directory: build
run: |
uv run --project .. --locked --no-sync gcovr \
--gcov-executable "gcov-${GCC_VERSION}" . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--verbose \
--xml-pretty \
-o coverage.xml
- name: Upload coverage artifact
if: >-
always() &&
(steps.test_report.outcome == 'success')
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage-Linux-${{ matrix.name }}
path: |
build/coverage.xml
build/tests/test_results.xml
if-no-files-found: error
- name: Upload Artifacts
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: build-Linux-${{ matrix.name }}
path: artifacts/
if-no-files-found: error