-
Notifications
You must be signed in to change notification settings - Fork 0
321 lines (274 loc) · 10.5 KB
/
e2e.yml
File metadata and controls
321 lines (274 loc) · 10.5 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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# SPDX-FileCopyrightText: © 2025 StreamKit Contributors
#
# SPDX-License-Identifier: MPL-2.0
name: E2E Tests
on:
workflow_call:
env:
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: sccache
jobs:
pipeline-validation:
name: Pipeline Validation
runs-on: ubuntu-22.04
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false
- uses: actions/checkout@v5
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.5"
- name: Build UI
working-directory: ./ui
run: |
bun install --frozen-lockfile
bun run build
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.92.0"
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm cmake ninja-build yasm meson ffmpeg
- name: Build and install SVT-AV1 from source (v4.1.0)
run: |
cd /tmp
git clone --depth 1 --branch v4.1.0 https://gitlab.com/AOMediaCodec/SVT-AV1.git
cd SVT-AV1
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build -j"$(nproc)"
sudo cmake --install build
sudo ldconfig
- name: Build skit
run: cargo build -p streamkit-server --bin skit --features "svt_av1 dav1d_static"
- name: Start skit server
run: |
SK_SERVER__ADDRESS=127.0.0.1:4545 ./target/debug/skit &
# Wait for the server to be healthy
HEALTHY=0
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:4545/healthz > /dev/null 2>&1; then
echo "skit is healthy"
HEALTHY=1
break
fi
sleep 1
done
if [ "$HEALTHY" -ne 1 ]; then
echo "ERROR: skit did not become healthy within 30s"
exit 1
fi
- name: Run pipeline validation tests (SW codecs only)
run: |
cd tests/pipeline-validation
PIPELINE_TEST_URL=http://127.0.0.1:4545 cargo test --test validate
pipeline-validation-gpu:
name: Pipeline Validation (GPU)
# Skip for fork PRs — self-hosted runners must not execute untrusted code.
# NOTE: we check `github.event.pull_request == null` instead of
# `github.event_name != 'pull_request'` because this workflow is invoked
# via `workflow_call`, which sets event_name to "workflow_call" regardless
# of the original trigger, making the event_name check always true.
if: github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository
runs-on: self-hosted
steps:
- uses: actions/checkout@v5
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.5"
- name: Build UI
working-directory: ./ui
run: |
bun install --frozen-lockfile
bun run build
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.92.0"
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm cmake ninja-build yasm meson ffmpeg libopus-dev pkg-config libssl-dev
- name: Build and install SVT-AV1 from source (v4.1.0)
run: |
cd /tmp
if pkg-config --atleast-version=2.0.0 SvtAv1Enc 2>/dev/null; then
echo "SVT-AV1 already installed, skipping build"
else
rm -rf SVT-AV1
git clone --depth 1 --branch v4.1.0 https://gitlab.com/AOMediaCodec/SVT-AV1.git
cd SVT-AV1
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build -j"$(nproc)"
sudo cmake --install build
sudo ldconfig
fi
- name: Build skit (with GPU + HW codecs + SVT-AV1 + dav1d)
env:
VPX_LIB_DIR: /usr/lib/x86_64-linux-gnu
VPX_INCLUDE_DIR: /usr/include
VPX_VERSION: "1.13.0"
CUDA_INCLUDE_PATH: /usr/include
# bindgen (used by shiguredo_nvcodec) needs the clang builtin include
# path so it can find stddef.h and other compiler-provided headers.
BINDGEN_EXTRA_CLANG_ARGS: "-I/usr/lib/llvm-18/lib/clang/18/include"
run: |
cargo build -p streamkit-server --bin skit --features "gpu nvcodec vulkan_video svt_av1 dav1d_static"
- name: Start skit server
run: |
# Use a non-default port to avoid conflicts with any persistent skit
# instance that may be running on the self-hosted runner.
SKIT_PORT=4546
RUST_LOG=info,streamkit_nodes::codec_utils=debug,streamkit_nodes::video::vulkan_video=debug,streamkit_nodes::core::bytes_output=debug SK_SERVER__ADDRESS=127.0.0.1:${SKIT_PORT} ./target/debug/skit > /tmp/skit-gpu.log 2>&1 &
echo $! > /tmp/skit-gpu.pid
# Wait for the server to be healthy
HEALTHY=0
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:${SKIT_PORT}/healthz > /dev/null 2>&1; then
echo "skit is healthy on port ${SKIT_PORT}"
HEALTHY=1
break
fi
sleep 1
done
if [ "$HEALTHY" -ne 1 ]; then
echo "ERROR: skit did not become healthy within 30s"
exit 1
fi
- name: Run pipeline validation tests (all codecs including GPU)
run: |
cd tests/pipeline-validation
PIPELINE_REQUIRE_NODES=1 PIPELINE_TEST_URL=http://127.0.0.1:4546 cargo test --test validate -- --test-threads=1
- name: Show skit server logs
if: always()
run: |
if [ -f /tmp/skit-gpu.log ]; then
echo "=== skit server logs (last 500 lines) ==="
tail -500 /tmp/skit-gpu.log
fi
- name: Stop skit server
if: always()
run: |
if [ -f /tmp/skit-gpu.pid ]; then
kill "$(cat /tmp/skit-gpu.pid)" 2>/dev/null || true
rm -f /tmp/skit-gpu.pid
fi
rm -f /tmp/skit-gpu.log
e2e:
name: Playwright E2E
runs-on: ubuntu-22.04
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false
- uses: actions/checkout@v5
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.5"
- name: Build UI
working-directory: ./ui
run: |
bun install --frozen-lockfile
bun run build
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.92.0"
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
- name: Install system dependencies (libvpx for VP9, nasm for AV1 assembly, meson for dav1d)
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm cmake ninja-build yasm meson
- name: Build and install SVT-AV1 from source (v4.1.0)
run: |
cd /tmp
git clone --depth 1 --branch v4.1.0 https://gitlab.com/AOMediaCodec/SVT-AV1.git
cd SVT-AV1
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build -j"$(nproc)"
sudo cmake --install build
sudo ldconfig
pkg-config --modversion SvtAv1Enc
- name: Build skit (debug, with SVT-AV1 + dav1d)
run: cargo build -p streamkit-server --bin skit --features "svt_av1 dav1d_static"
- name: Build moq-relay for relay e2e tests
run: |
set -euo pipefail
MOQ_RELAY_COMMIT="8b1d09c7a53bad1c573bff648c593cb1903c96f7"
RELAY_BIN="target/moq-relay/moq-relay"
COMMIT_FILE="target/moq-relay/.commit"
if [ -f "$RELAY_BIN" ] && [ -f "$COMMIT_FILE" ] && [ "$(cat "$COMMIT_FILE")" = "$MOQ_RELAY_COMMIT" ]; then
echo "moq-relay binary already exists for commit $MOQ_RELAY_COMMIT — skipping build"
exit 0
fi
CLONE_DIR="target/moq-relay-src"
echo "Cloning moq-dev/moq at $MOQ_RELAY_COMMIT..."
if [ ! -d "$CLONE_DIR/.git" ]; then
rm -rf "$CLONE_DIR"
git clone --depth 1 https://github.com/moq-dev/moq.git "$CLONE_DIR"
fi
cd "$CLONE_DIR"
git fetch origin "$MOQ_RELAY_COMMIT" --depth 1
git checkout "$MOQ_RELAY_COMMIT"
echo "Building moq-relay (release)..."
cargo build -p moq-relay --release
cd ../..
mkdir -p target/moq-relay
cp "$CLONE_DIR/target/release/moq-relay" "$RELAY_BIN"
echo "$MOQ_RELAY_COMMIT" > "$COMMIT_FILE"
echo "moq-relay binary ready at $RELAY_BIN"
- name: Install E2E dependencies
working-directory: ./e2e
run: bun install --frozen-lockfile
- name: Install Playwright browsers
working-directory: ./e2e
run: bunx playwright install chromium --with-deps
- name: Lint E2E (typecheck + prettier)
working-directory: ./e2e
run: bun run lint
- name: Run E2E tests
working-directory: ./e2e
run: bun run test
- name: Run E2E tests (auth enabled)
working-directory: ./e2e
run: E2E_AUTH=1 bun run test
- name: Run E2E perf tests (dev server)
run: .github/scripts/run-perf-e2e.sh
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 7
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-results
path: e2e/test-results/
retention-days: 7