@@ -12,10 +12,8 @@ permissions:
1212
1313env :
1414 CARGO_TERM_COLOR : always
15- # Disable Cargo incremental artifacts. The Rust FFI is built once per
16- # submodule SHA and cached whole (see the cargo target cache below), so
17- # incremental dirs add nothing but bloat the cached target/ directory and
18- # slow the cache upload/download.
15+ # Cache both feature-specific Rust builds per submodule SHA. Cargo
16+ # incremental codegen directories add cache size without helping CMake reuse.
1917 CARGO_INCREMENTAL : " 0"
2018 # vcpkg binary caching for Windows. The x-gha backend was removed from vcpkg,
2119 # so use vcpkg's files provider and persist that directory with actions/cache.
@@ -34,71 +32,41 @@ jobs:
3432 include :
3533 - os : ubuntu-22.04
3634 name : ubuntu-22.04-x64
37- build_cmd : ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-x64
35+ build_cmd : ./build.sh release-examples --no-capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-x64
36+ capture_build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-x64-capture
3837 build_dir : build-release
3938 - os : ubuntu-22.04-arm
4039 name : ubuntu-22.04-arm64
41- build_cmd : ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-arm64
40+ build_cmd : ./build.sh release-examples --no-capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-arm64
41+ capture_build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-arm64-capture
4242 build_dir : build-release
4343 - os : ubuntu-24.04
4444 name : ubuntu-24.04-x64
45- build_cmd : ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-x64
45+ build_cmd : ./build.sh release-examples --no-capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-x64
46+ capture_build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-x64-capture
4647 build_dir : build-release
4748 - os : ubuntu-24.04-arm
4849 name : ubuntu-24.04-arm64
49- build_cmd : ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-arm64
50+ build_cmd : ./build.sh release-examples --no-capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-arm64
51+ capture_build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-arm64-capture
5052 build_dir : build-release
5153 - os : macos-26-xlarge
5254 name : macos-arm64
53- build_cmd : ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-macos-arm64
55+ build_cmd : ./build.sh release-examples --no-capture --bundle --prefix sdk-out/livekit-sdk-macos-arm64
56+ capture_build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-macos-arm64-capture
5457 build_dir : build-release
5558 - os : macos-26-large
5659 name : macos-x64
57- build_cmd : ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-macos-x64 --macos-arch x86_64
60+ build_cmd : ./build.sh release-examples --no-capture --bundle --prefix sdk-out/livekit-sdk-macos-x64 --macos-arch x86_64
61+ capture_build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-macos-x64-capture --macos-arch x86_64
5862 build_dir : build-release
5963 # Pinned to Windows 2022 for current VS 17 implementation
6064 - os : windows-2022
6165 name : windows-x64
62- build_cmd : .\build.cmd release-examples --bundle --prefix sdk-out\livekit-sdk-windows-x64
66+ build_cmd : .\build.cmd release-examples --no-capture --bundle --prefix sdk-out\livekit-sdk-windows-x64
67+ capture_build_cmd : .\build.cmd release-examples --capture --bundle --prefix sdk-out\livekit-sdk-windows-x64-capture
6368 build_dir : build-release
6469
65- - os : ubuntu-22.04
66- name : ubuntu-22.04-x64-capture
67- build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-x64-capture
68- build_dir : build-release
69- capture : true
70- - os : ubuntu-22.04-arm
71- name : ubuntu-22.04-arm64-capture
72- build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-arm64-capture
73- build_dir : build-release
74- capture : true
75- - os : ubuntu-24.04
76- name : ubuntu-24.04-x64-capture
77- build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-x64-capture
78- build_dir : build-release
79- capture : true
80- - os : ubuntu-24.04-arm
81- name : ubuntu-24.04-arm64-capture
82- build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-arm64-capture
83- build_dir : build-release
84- capture : true
85- - os : macos-26-xlarge
86- name : macos-arm64-capture
87- build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-macos-arm64-capture
88- build_dir : build-release
89- capture : true
90- - os : macos-26-large
91- name : macos-x64-capture
92- build_cmd : ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-macos-x64-capture --macos-arch x86_64
93- build_dir : build-release
94- # Pinned to Windows 2022 for current VS 17 implementation
95- capture : true
96- - os : windows-2022
97- name : windows-x64-capture
98- build_cmd : .\build.cmd release-examples --capture --bundle --prefix sdk-out\livekit-sdk-windows-x64-capture
99- build_dir : build-release
100- capture : true
101-
10270 name : Build (${{ matrix.name }})
10371 runs-on : ${{ matrix.os }}
10472
@@ -186,10 +154,6 @@ jobs:
186154 brew update
187155 brew install cmake ninja protobuf abseil
188156
189- - name : Set up capture dependencies
190- if : matrix.capture == true
191- uses : ./.github/actions/setup-capture
192-
193157 # ---------- Rust toolchain ----------
194158 - name : Install Rust (stable)
195159 uses : dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f
@@ -234,9 +198,9 @@ jobs:
234198 path : |
235199 client-sdk-rust/target/
236200 ${{ env.CARGO_TARGET_DIR }}
237- key : ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v2 -${{ steps.rust_sha.outputs.sha }}
201+ key : ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3 -${{ steps.rust_sha.outputs.sha }}
238202 restore-keys : |
239- ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v2 -
203+ ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3 -
240204
241205 # restore-keys can hydrate target/ from a prior submodule SHA. cxxbridge
242206 # artifacts in webrtc-sys are not compatible across those bumps.
@@ -268,26 +232,6 @@ jobs:
268232 shell : pwsh
269233 run : ${{ matrix.build_cmd }}
270234
271- # Save the populated target/ now, while the build output still exists and
272- # before the "Clean after build" step runs clean-all. Save only from main
273- # pushes so PRs restore from the shared main cache instead of creating
274- # large PR-scoped target caches that quickly evict useful entries.
275- - name : Save cargo target
276- if : github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.cache-cargo-target.outputs.cache-hit != 'true'
277- uses : actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
278- with :
279- path : |
280- client-sdk-rust/target/
281- ${{ env.CARGO_TARGET_DIR }}
282- key : ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v2-${{ steps.rust_sha.outputs.sha }}
283-
284- - name : Save vcpkg binary cache
285- if : runner.os == 'Windows' && steps.cache-vcpkg-binary.outputs.cache-hit != 'true'
286- uses : actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
287- with :
288- path : ${{ env.VCPKG_BINARY_CACHE_DIR }}
289- key : ${{ runner.os }}-${{ matrix.name }}-vcpkg-binary-${{ env.VCPKG_TARGET_TRIPLET }}-${{ env.VCPKG_GIT_COMMIT }}-${{ hashFiles('vcpkg.json') }}
290-
291235 # ---------- Smoke test cpp-example-collection binaries ----------
292236 # Built under cpp-example-collection-build/ (not build-dir/bin). Visual Studio
293237 # multi-config places executables in per-target Release/ (or Debug/) subdirs.
@@ -393,36 +337,37 @@ jobs:
393337 run : |
394338 set -euo pipefail
395339 bundle="sdk-out/livekit-sdk-${{ matrix.name }}"
340+ grep -F "#define LIVEKIT_CAPTURE_ENABLED 0" "${bundle}/include/livekit/build.h"
396341 test -f "${bundle}/include/livekit/livekit.h"
397342 test -f "${bundle}/share/livekit/build-info.json"
398343 test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfig.cmake"
399344 test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfigVersion.cmake"
400345 test -f "${bundle}/lib/cmake/LiveKit/LiveKitTargets.cmake"
401346
402- - name : Test installed capture SDK (Unix)
403- if : matrix.capture == true && runner.os != 'Windows'
347+ - name : Test installed standard SDK (Unix)
348+ if : runner.os != 'Windows'
404349 shell : bash
405350 run : |
406351 bundle="$GITHUB_WORKSPACE/sdk-out/livekit-sdk-${{ matrix.name }}"
407352 arch_args=()
408353 if [[ "${{ matrix.name }}" == macos-x64* ]]; then arch_args+=(-DCMAKE_OSX_ARCHITECTURES=x86_64); fi
409- cmake -S src/tests/packaging -B build-packaging-tests -G Ninja \
354+ cmake -S src/tests/packaging -B build-packaging-standard -G Ninja \
410355 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$bundle" \
411- -DLIVEKIT_EXPECT_CAPTURE=ON "${arch_args[@]}"
412- cmake --build build-packaging-tests
413- ctest --test-dir build-packaging-tests -C Release --output-on-failure -L packaging
356+ -DLIVEKIT_EXPECT_CAPTURE=OFF "${arch_args[@]}"
357+ cmake --build build-packaging-standard
358+ ctest --test-dir build-packaging-standard -C Release --output-on-failure -L packaging
414359
415- - name : Test installed capture SDK (Windows)
416- if : matrix.capture == true && runner.os == 'Windows'
360+ - name : Test installed standard SDK (Windows)
361+ if : runner.os == 'Windows'
417362 shell : pwsh
418363 run : |
419364 $bundle = Join-Path $env:GITHUB_WORKSPACE "sdk-out/livekit-sdk-${{ matrix.name }}"
420- cmake -S src/tests/packaging -B build-packaging-tests -DCMAKE_PREFIX_PATH="$bundle" -DLIVEKIT_EXPECT_CAPTURE=ON
365+ cmake -S src/tests/packaging -B build-packaging-standard -DCMAKE_PREFIX_PATH="$bundle" -DLIVEKIT_EXPECT_CAPTURE=OFF
421366 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
422- cmake --build build-packaging-tests --config Release
367+ cmake --build build-packaging-standard --config Release
423368 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
424369 $env:PATH = "$bundle\bin;$env:PATH"
425- ctest --test-dir build-packaging-tests -C Release --output-on-failure -L packaging
370+ ctest --test-dir build-packaging-standard -C Release --output-on-failure -L packaging
426371 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
427372
428373 # ---------- Upload artifacts ----------
@@ -433,6 +378,186 @@ jobs:
433378 path : sdk-out/livekit-sdk-${{ matrix.name }}
434379 retention-days : 7
435380
381+ # Reconfigure the same CMake tree after the standard bundle and aliases
382+ # have been validated and uploaded. Keep both install prefixes separate.
383+ - name : Set up capture dependencies
384+ uses : ./.github/actions/setup-capture
385+
386+ - name : Rebuild with capture (Unix)
387+ if : runner.os != 'Windows'
388+ shell : bash
389+ run : |
390+ chmod +x build.sh
391+ ${{ matrix.capture_build_cmd }}
392+
393+ - name : Rebuild with capture (Windows)
394+ if : runner.os == 'Windows'
395+ shell : pwsh
396+ run : ${{ matrix.capture_build_cmd }}
397+
398+ - name : Smoke test capture examples (Unix)
399+ if : runner.os != 'Windows'
400+ shell : bash
401+ run : |
402+ set -x
403+ failed=false
404+ examples_base="${{ matrix.build_dir }}/cpp-example-collection-build"
405+ resolve_exe() {
406+ local dir="$1" name="$2"
407+ local p="${examples_base}/${dir}/${name}"
408+ if [[ -x "${p}" ]]; then
409+ printf '%s' "${p}"
410+ return 0
411+ fi
412+ p="${examples_base}/${dir}/Release/${name}"
413+ if [[ -x "${p}" ]]; then
414+ printf '%s' "${p}"
415+ return 0
416+ fi
417+ return 1
418+ }
419+ for pair in "SimpleRoom:simple_room" "SimpleRpc:simple_rpc" "SimpleDataStream:simple_data_stream"; do
420+ exe="${pair%%:*}"
421+ dir="${pair#*:}"
422+ if ! exe_path="$(resolve_exe "${dir}" "${exe}")"; then
423+ echo "ERROR: ${exe} not found under ${examples_base}/${dir}/"
424+ failed=true
425+ continue
426+ fi
427+ echo "Testing ${exe}..."
428+ output=$("${exe_path}" --help 2>&1) || true
429+ if [[ -z "${output}" ]]; then
430+ echo "ERROR: ${exe} produced no output"
431+ failed=true
432+ else
433+ echo "${output}"
434+ echo "${exe} ran successfully"
435+ fi
436+ done
437+ if [[ "$failed" == "true" ]]; then exit 1; fi
438+
439+ - name : Smoke test capture examples (Windows)
440+ if : runner.os == 'Windows'
441+ shell : pwsh
442+ run : |
443+ $ErrorActionPreference = 'Continue'
444+ $examplesBase = "${{ matrix.build_dir }}/cpp-example-collection-build"
445+ $examples = @(
446+ @{ Name = 'SimpleRoom'; Dir = 'simple_room' },
447+ @{ Name = 'SimpleRpc'; Dir = 'simple_rpc' },
448+ @{ Name = 'SimpleDataStream'; Dir = 'simple_data_stream' }
449+ )
450+ $failed = $false
451+ foreach ($ex in $examples) {
452+ $name = $ex.Name
453+ $dir = $ex.Dir
454+ $inDir = Join-Path $examplesBase $dir
455+ $candidates = @(
456+ (Join-Path $inDir "$name.exe"),
457+ (Join-Path (Join-Path $inDir 'Release') "$name.exe")
458+ )
459+ $exePath = $null
460+ foreach ($p in $candidates) {
461+ if (Test-Path -LiteralPath $p) {
462+ $exePath = $p
463+ break
464+ }
465+ }
466+ if ($null -ne $exePath) {
467+ Write-Host "Testing ${name}..."
468+ $pinfo = New-Object System.Diagnostics.ProcessStartInfo
469+ $pinfo.FileName = $exePath
470+ $pinfo.Arguments = "--help"
471+ $pinfo.RedirectStandardOutput = $true
472+ $pinfo.RedirectStandardError = $true
473+ $pinfo.UseShellExecute = $false
474+ $p = New-Object System.Diagnostics.Process
475+ $p.StartInfo = $pinfo
476+ $p.Start() | Out-Null
477+ $stdout = $p.StandardOutput.ReadToEnd()
478+ $stderr = $p.StandardError.ReadToEnd()
479+ $p.WaitForExit()
480+ $output = $stdout + $stderr
481+ if ([string]::IsNullOrWhiteSpace($output)) {
482+ Write-Host "ERROR: ${name} produced no output"
483+ $failed = $true
484+ } else {
485+ Write-Host $output
486+ Write-Host "${name} ran successfully"
487+ }
488+ } else {
489+ Write-Host "ERROR: ${name} not found under ${examplesBase}/${dir}/"
490+ $failed = $true
491+ }
492+ }
493+ if ($failed) { exit 1 } else { exit 0 }
494+
495+ - name : Verify capture SDK bundle
496+ shell : bash
497+ run : |
498+ set -euo pipefail
499+ bundle="sdk-out/livekit-sdk-${{ matrix.name }}-capture"
500+ grep -F "#define LIVEKIT_CAPTURE_ENABLED 1" "${bundle}/include/livekit/build.h"
501+ test -f "${bundle}/include/livekit/livekit.h"
502+ test -f "${bundle}/share/livekit/build-info.json"
503+ test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfig.cmake"
504+ test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfigVersion.cmake"
505+ test -f "${bundle}/lib/cmake/LiveKit/LiveKitTargets.cmake"
506+
507+ - name : Test installed capture SDK (Unix)
508+ if : runner.os != 'Windows'
509+ shell : bash
510+ run : |
511+ bundle="$GITHUB_WORKSPACE/sdk-out/livekit-sdk-${{ matrix.name }}-capture"
512+ arch_args=()
513+ if [[ "${{ matrix.name }}" == macos-x64 ]]; then arch_args+=(-DCMAKE_OSX_ARCHITECTURES=x86_64); fi
514+ cmake -S src/tests/packaging -B build-packaging-capture -G Ninja \
515+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$bundle" \
516+ -DLIVEKIT_EXPECT_CAPTURE=ON "${arch_args[@]}"
517+ cmake --build build-packaging-capture
518+ ctest --test-dir build-packaging-capture -C Release --output-on-failure -L packaging
519+
520+ - name : Test installed capture SDK (Windows)
521+ if : runner.os == 'Windows'
522+ shell : pwsh
523+ run : |
524+ $bundle = Join-Path $env:GITHUB_WORKSPACE "sdk-out/livekit-sdk-${{ matrix.name }}-capture"
525+ cmake -S src/tests/packaging -B build-packaging-capture -DCMAKE_PREFIX_PATH="$bundle" -DLIVEKIT_EXPECT_CAPTURE=ON
526+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
527+ cmake --build build-packaging-capture --config Release
528+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
529+ $env:PATH = "$bundle\bin;$env:PATH"
530+ ctest --test-dir build-packaging-capture -C Release --output-on-failure -L packaging
531+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
532+
533+ - name : Upload capture SDK bundle
534+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
535+ with :
536+ name : livekit-sdk-${{ matrix.name }}-capture
537+ path : sdk-out/livekit-sdk-${{ matrix.name }}-capture
538+ retention-days : 7
539+
540+ # Save the populated target/ now, while the build output still exists and
541+ # before the "Clean after build" step runs clean-all. Save only from main
542+ # pushes so PRs restore from the shared main cache instead of creating
543+ # large PR-scoped target caches that quickly evict useful entries.
544+ - name : Save cargo target
545+ if : github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.cache-cargo-target.outputs.cache-hit != 'true'
546+ uses : actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
547+ with :
548+ path : |
549+ client-sdk-rust/target/
550+ ${{ env.CARGO_TARGET_DIR }}
551+ key : ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3-${{ steps.rust_sha.outputs.sha }}
552+
553+ - name : Save vcpkg binary cache
554+ if : runner.os == 'Windows' && steps.cache-vcpkg-binary.outputs.cache-hit != 'true'
555+ uses : actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
556+ with :
557+ path : ${{ env.VCPKG_BINARY_CACHE_DIR }}
558+ key : ${{ runner.os }}-${{ matrix.name }}-vcpkg-binary-${{ env.VCPKG_TARGET_TRIPLET }}-${{ env.VCPKG_GIT_COMMIT }}-${{ hashFiles('vcpkg.json') }}
559+
560+
436561 # ---------- Cleanup ----------
437562 - name : Clean after build (best-effort)
438563 if : always()
0 commit comments