Skip to content

feat(desktop-gpui): download captions as SRT or WebVTT #16128

feat(desktop-gpui): download captions as SRT or WebVTT

feat(desktop-gpui): download captions as SRT or WebVTT #16128

Workflow file for this run

name: "CI"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
pull-requests: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
# A cancelled main run never reaches its cache save. Main runs still never
# pile up: GitHub keeps at most one pending run per group.
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
changes:
name: Detect Changes
runs-on: blacksmith-8vcpu-ubuntu-2404
outputs:
rust: ${{ steps.filter.outputs.rust }}
# apps/cli is in the root workspace only; the GPUI app is its own
# workspace and never builds it, so CLI-only changes skip the app jobs.
gpui: ${{ steps.filter.outputs.rust-without-cli == 'true' || steps.filter.outputs.gpui == 'true' }}
gpui-patches: ${{ steps.filter.outputs.gpui-patches }}
ios: ${{ steps.filter.outputs.ios }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
rust:
- '.cargo/**'
- '.github/actions/install-desktop-deps/**'
- '.github/actions/setup-rust-cache/**'
- '.github/workflows/ci.yml'
- 'apps/cli/**'
- 'crates/**'
- 'vendor/**'
- 'scripts/diagnostic-build.rs'
- 'scripts/setup*'
- 'Cargo.toml'
- 'Cargo.lock'
rust-without-cli:
- '.cargo/**'
- '.github/actions/install-desktop-deps/**'
- '.github/actions/setup-rust-cache/**'
- '.github/workflows/ci.yml'
- 'crates/**'
- 'vendor/**'
- 'scripts/diagnostic-build.rs'
- 'scripts/setup*'
- 'Cargo.toml'
- 'Cargo.lock'
gpui:
- '.gitattributes'
- 'scripts/setup.js'
- 'apps/desktop-gpui/**'
- 'apps/media-server/src/__tests__/fixtures/**'
- 'scripts/build-desktop-binaries*'
- 'scripts/build-gpui-binary.sh'
- 'scripts/build-linux-packages.mjs'
- 'scripts/build-macos-packages*'
- 'scripts/bundle-gpui*'
- 'scripts/finalize-linux-*'
- 'scripts/finalize-macos-*'
- 'scripts/linux-bundle-config*'
- 'scripts/prepare-gpui-dependency*'
- 'scripts/sync-desktop-versions.mjs'
- 'scripts/verify-windows-stack.mjs'
gpui-patches:
- 'apps/desktop-gpui/patches/**'
- 'scripts/prepare-gpui-dependency.sh'
ios:
- 'apps/mobile-ios/**'
typecheck:
name: Typecheck
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/setup-js
- run: bun run --cwd apps/web next typegen
- name: Check MCP card bundle
run: bun run --cwd apps/web mcp-card:check
- name: Test workspace tooling
run: |
node --test scripts/bun-scripts.test.mjs
- name: Test Loops profile sync
run: |
bun test scripts/loops/profile.test.ts scripts/loops/lifecycle.test.ts
bun run tsc --noEmit --strict --jsx react-jsx --allowImportingTsExtensions --target ESNext --module ESNext --moduleResolution bundler --resolveJsonModule --types bun --skipLibCheck scripts/loops/*.ts
- name: Test Chrome extension
run: bun run --cwd apps/chrome-extension test
- name: Test recorder SDK
run: bun --no-install test packages/sdk-recorder
- name: Test render farm orchestration
run: |
bun test apps/render-farm
bun run --cwd apps/render-farm typecheck
- name: Typecheck
run: bun run typecheck
web-tests:
name: Web tests
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/setup-js
- run: bun run --cwd apps/web next typegen
# The whole web unit suite, about a minute on this runner.
- name: Test web
run: bun run --cwd apps/web test __tests__/unit
ios:
name: iOS
needs: changes
if: needs.changes.outputs.ios == 'true'
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test CapKit
working-directory: apps/mobile-ios/CapKit
run: swift test
- name: Build app
working-directory: apps/mobile-ios
run: >-
xcodebuild -project Cap.xcodeproj -scheme Cap -configuration Release
-destination "generic/platform=iOS Simulator"
-derivedDataPath "$RUNNER_TEMP/cap-ios"
CODE_SIGNING_ALLOWED=NO build
format-biome:
name: Format (Biome)
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
# Don't use `latest` as Biome throws an error when it doesn't match the
# schema version in the config file.
version: 2.2.0
- name: Run Biome
run: biome ci . --linter-enabled=false
format-rust:
name: Format (Cargo)
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88.0
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --check
clippy:
name: Clippy
needs: changes
if: needs.changes.outputs.rust == 'true'
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
settings:
- target: aarch64-apple-darwin
runner: blacksmith-6vcpu-macos-15
- target: x86_64-pc-windows-msvc
runner: blacksmith-8vcpu-windows-2025
runs-on: ${{ matrix.settings.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@1.88.0
with:
targets: ${{ matrix.settings.target }}
components: clippy
- uses: ./.github/actions/setup-rust-cache
with:
target: ${{ matrix.settings.target }}
prefix-key: v1-rust-clippy
save-cache: ${{ github.ref == 'refs/heads/main' }}
- name: Run setup
shell: bash
run: node scripts/setup.js
env:
RUST_TARGET_TRIPLE: ${{ matrix.settings.target }}
- name: Test desktop installation and storage helpers
shell: bash
run: cargo test --locked -p cap-utils -p cap-cli-install --lib
- name: Run Clippy
run: cargo clippy --workspace --all-features --locked -- -D warnings
lint-biome:
name: Lint (Biome)
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci . || true
rust-tests:
name: Rust tests (Linux)
needs: changes
if: needs.changes.outputs.rust == 'true'
timeout-minutes: 60
runs-on: blacksmith-8vcpu-ubuntu-2404
env:
RUST_TARGET_TRIPLE: x86_64-unknown-linux-gnu
LD_LIBRARY_PATH: ${{ github.workspace }}/target/native-deps/lib:${{ github.workspace }}/target/debug
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Linux desktop dependencies
uses: ./.github/actions/install-desktop-deps
- name: Rust setup
uses: dtolnay/rust-toolchain@1.88.0
- uses: ./.github/actions/setup-rust-cache
with:
target: x86_64-unknown-linux-gnu
prefix-key: v1-rust-tests
save-cache: ${{ github.ref == 'refs/heads/main' }}
- name: Test native dependency setup
run: node --test scripts/setup.test.mjs
- name: Run setup
run: node scripts/setup.js
- name: Test CLI Studio automation duration
run: cargo test --locked -p cap --bin cap automation::tests::studio_recording_duration_conditions_use_recorded_media
- name: Test desktop regressions
run: |
cargo test --locked -p cap-utils -p cap-cli-install --lib
cargo test --locked -p cap-automation
cargo test --locked -p cap --bin cap record::tests
cargo test --locked -p cap --bin cap recordings::tests
cargo test --locked -p cap --bin cap automation::tests::cli_save_to_location
cargo test --locked -p cap --bin cap export::tests::instant_export_preserves_a_hard_link_to_the_recording
cargo test --locked -p cap --test cli recordings_list
cargo test --locked -p cap --test cli project_config_get_without_file_returns_default
cargo test --locked -p cap --test cli caps_json_errors_include_the_standard_error_field
cargo test --locked -p cap --bin cap caps::tests::cap_operations_validate_wait_timeouts_before_submitting
cargo test --locked -p cap --test cli organization_operations_validate_wait_timeouts_before_submitting
cargo test --locked -p cap --bin cap developer_media::tests
cargo test --locked -p cap --test cli developer_ids_that_begin_with_a_dash_are_read_as_values
cargo test --locked -p cap --test cli developer_dry_runs_show_the_target_and_change_nothing
cargo test --locked -p cap --test cli commands_without_their_own_json_errors_still_print_one
cargo test --locked -p cap-recording --lib -- --test-threads=1
cargo test --locked -p cap-recording --test x11_shm_capture -- --test-threads=1
cargo test --locked -p scap-targets --lib --test linux_targets
cargo test --locked -p cap-enc-ffmpeg -p cap-camera-ffmpeg
build-gpui:
name: Build GPUI Desktop
needs: changes
if: needs.changes.outputs.gpui == 'true'
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
settings:
- target: aarch64-apple-darwin
runner: blacksmith-6vcpu-macos-15
# Cap still ships an Intel build, and Blacksmith has no Intel Macs.
- target: x86_64-apple-darwin
runner: macos-26-intel
- target: x86_64-pc-windows-msvc
runner: blacksmith-8vcpu-windows-2025
- target: x86_64-unknown-linux-gnu
runner: blacksmith-8vcpu-ubuntu-2404
# The Intel build is not a merge gate and takes over an hour on a
# GitHub-hosted runner, so it runs on main and by hand, not on PRs.
exclude:
- settings:
target: x86_64-apple-darwin
runner: ${{ github.event_name == 'pull_request' && 'macos-26-intel' || 'none' }}
runs-on: ${{ matrix.settings.runner }}
env:
# Full debuginfo for the opt-level 2 dependency tree is most of the
# target dir and the link time, and nothing in CI reads it.
CARGO_PROFILE_DEV_DEBUG: "0"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test desktop build preparation
run: node --test scripts/prepare-gpui-dependency.test.mjs scripts/build-macos-packages.test.mjs scripts/bundle-gpui.test.mjs scripts/finalize-macos-packages.test.mjs
- name: Test Linux packaging
if: ${{ runner.os == 'Linux' }}
run: node --test scripts/linux-bundle-config.test.mjs scripts/finalize-linux-appimage.test.mjs scripts/finalize-linux-gpui-packages.test.mjs
- name: Install Linux desktop dependencies
if: ${{ runner.os == 'Linux' }}
uses: ./.github/actions/install-desktop-deps
- name: Rust setup
uses: dtolnay/rust-toolchain@1.95.0
with:
targets: ${{ matrix.settings.target }}
- uses: ./.github/actions/setup-rust-cache
with:
target: ${{ matrix.settings.target }}
prefix-key: v1-rust-gpui
save-cache: ${{ github.ref == 'refs/heads/main' }}
workspaces: apps/desktop-gpui -> target
- name: Run setup
shell: bash
run: node scripts/setup.js
env:
RUST_TARGET_TRIPLE: ${{ matrix.settings.target }}
# The ONNX Runtime setup.js prepares must load through ort's C API and
# run a real inference on every platform Cap ships. On macOS setup.js
# also strips the dylib's local symbols, so check the API still resolves.
- name: Test the prepared ONNX Runtime
shell: bash
run: |
set -euo pipefail
if [[ "$RUNNER_OS" == "macOS" ]]; then
nm -gU target/native-deps/onnxruntime/lib/libonnxruntime.dylib | grep -q OrtGetApiBase
fi
cargo test --locked -p cap-camera-effects --lib segmentation::tests::inference_runs_from_a_caller_with_a_tiny_stack -- --ignored --exact
# The test build compiles every line the binary build does (the app has
# no cfg(not(test)) code), so a separate binary build only repeated the
# app crate's compile and link. Release builds still produce the binary.
- name: Prepare GPUI dependency
shell: bash
run: |
node scripts/sync-desktop-versions.mjs
./scripts/prepare-gpui-dependency.sh
- name: Test GPUI desktop
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
debug_path="$(cygpath "$GITHUB_WORKSPACE/target/debug")"
export PATH="$debug_path:$PATH"
elif [[ "$RUNNER_OS" == "macOS" ]]; then
frameworks="$GITHUB_WORKSPACE/apps/desktop-gpui/target/${{ matrix.settings.target }}/debug/Frameworks"
mkdir -p "$frameworks"
ln -sfn "$GITHUB_WORKSPACE/target/Frameworks/Spacedrive.framework" "$frameworks/Spacedrive.framework"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
export LD_LIBRARY_PATH="$GITHUB_WORKSPACE/target/native-deps/lib:$GITHUB_WORKSPACE/target/debug:$GITHUB_WORKSPACE/target/${{ matrix.settings.target }}/debug${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
if [[ "$RUNNER_OS" == "Linux" ]]; then
xvfb-run -a --server-args="-screen 0 1920x1080x24 -noreset" \
cargo +1.95.0 test --manifest-path apps/desktop-gpui/Cargo.toml --locked --target ${{ matrix.settings.target }} --bin cap-gpui
else
cargo +1.95.0 test --manifest-path apps/desktop-gpui/Cargo.toml --locked --target ${{ matrix.settings.target }} --bin cap-gpui
fi
cargo +1.95.0 test --manifest-path apps/desktop-gpui/Cargo.toml --locked --target ${{ matrix.settings.target }} -p cap-gpui-kernels
cargo +1.95.0 test --manifest-path apps/desktop-gpui/Cargo.toml --locked --target ${{ matrix.settings.target }} -p cap-glass
cargo +1.95.0 test --manifest-path apps/desktop-gpui/Cargo.toml --locked --target ${{ matrix.settings.target }} -p cap-i18n-build
# Cap only builds gpui's crates as dependencies, so their own tests never run
# in the app jobs above. Run the ones covering Cap's patches against real
# devices: Metal on macOS, WARP on Windows, and Mesa's lavapipe (Vulkan) and
# llvmpipe (GL) on Linux. Windows renders with D3D11 and its runners expose
# no wgpu adapter, so wgpu's tests run on macOS and Linux only. Zed's lockfile predates the patches' dependency
# changes, so these builds cannot use --locked.
gpui-patch-tests:
name: GPUI patch tests (${{ matrix.settings.name }})
needs: changes
if: needs.changes.outputs.gpui-patches == 'true'
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
settings:
- name: macOS
runner: blacksmith-6vcpu-macos-15
- name: Windows
runner: blacksmith-8vcpu-windows-2025
- name: Linux
runner: blacksmith-8vcpu-ubuntu-2404
runs-on: ${{ matrix.settings.runner }}
env:
CARGO_PROFILE_DEV_DEBUG: "0"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Linux desktop dependencies
if: ${{ runner.os == 'Linux' }}
uses: ./.github/actions/install-desktop-deps
- name: Install software GPU drivers
if: ${{ runner.os == 'Linux' }}
run: sudo apt-get install -y --no-install-recommends mesa-vulkan-drivers libvulkan1 libegl1 libegl-mesa0 libgl1-mesa-dri
- name: Allow long paths in Zed's git dependencies
if: ${{ runner.os == 'Windows' }}
run: git config --global core.longpaths true
- name: Rust setup
uses: dtolnay/rust-toolchain@1.95.0
- name: Prepare GPUI dependency
shell: bash
run: ./scripts/prepare-gpui-dependency.sh
- name: Test GPUI patches
shell: bash
working-directory: ../zed-cap
env:
GPUI_REQUIRE_TEST_DEVICE: "1"
run: |
cargo +1.95.0 test -p gpui --lib stream
if [[ "$RUNNER_OS" == "Linux" ]]; then
WGPU_BACKEND=vulkan cargo +1.95.0 test -p gpui_wgpu --lib wgpu_atlas -- --nocapture
WGPU_BACKEND=gl cargo +1.95.0 test -p gpui_wgpu --lib wgpu_atlas -- --nocapture
cargo +1.95.0 test -p gpui_linux --lib -- unmapped_frame retained_visibility
elif [[ "$RUNNER_OS" == "macOS" ]]; then
cargo +1.95.0 test -p gpui_wgpu --lib wgpu_atlas -- --nocapture
# Run under lldb: a SIGSEGV in these tests (1 run in about 36 so
# far) leaves no Rust backtrace, and Blacksmith's macOS VMs write
# no crash reports. lldb exits 0 whatever the tests return, so
# pass their exit status through.
exe=$(cargo +1.95.0 test -p gpui_macos --lib --no-run --message-format json \
| jq -r 'select(.reason == "compiler-artifact" and .target.name == "gpui_macos" and .profile.test) | .executable' | tail -1)
lldb --batch -o "process launch" -k "thread backtrace all" -k "quit 1" \
-- "$exe" metal_atlas metal_renderer 2>&1 | tee "$RUNNER_TEMP/gpui-macos-tests.log"
if grep -q "stop reason = " "$RUNNER_TEMP/gpui-macos-tests.log"; then
echo "::error::gpui_macos tests crashed; the backtrace is above"
exit 1
fi
status=$(sed -n 's/.*exited with status = \([0-9]*\).*/\1/p' "$RUNNER_TEMP/gpui-macos-tests.log" | tail -1)
[[ "$status" == 0 ]] || { echo "::error::gpui_macos tests exited with status ${status:-unknown}"; exit 1; }
else
cargo +1.95.0 test -p gpui_windows --lib directx_atlas
fi