Skip to content

infra: CI: PR runs spend most of their time on per-run setup #427

Closed

Description

@rdoupe

PR runs take 11 min median, 19 min at p90 and up to 33 min (last 59 completed PR runs); master pushes take 16 min median. Each PR run occupies 5 macOS slots, the whole free-tier macOS cap, so overlapping PRs queue.

Step-level logs of recent runs show most of that time is setup rebuilt from scratch every run, not compiles or tests. Plan, one commit or PR at a time, each measured before and after. Nothing here drops a test or a compile unless stated.

  1. Flatpak (12 min, the critical path): the "Prepare build space" step deletes about 24 GB of preinstalled runner tools (Android, CodeQL, .NET, …) in 1 min 41 s, but the runner already has 84 GB free. Measure the build's peak disk use, then run the cleanup only when free space is below that plus a margin. Also skip the 163 s debuginfo compression of libcef.so on non-release runs.
  2. Rust Tier 2 Linux: the ubuntu:26.04 Docker image (80 apt packages + rustup) is rebuilt uncached every run, 2 min 25 s of a 3 min 36 s job. Cache it with buildx and the GitHub Actions cache.
  3. Rust Tier 2 Windows: cmocka is built from source via vcpkg every run, and 548 C files compile twice without ccache. Add the ccache setup the Windows build job already has and a vcpkg binary cache.
  4. Rust Tier 2 macOS: builds cold twice; restore the Xcode cache the macOS build job already has.
  5. Format jobs: brew installs zsh and the formatter each run (over 1 min each); the local gate runs the same pinned tools through uvx in seconds.
  6. Minor: apt instead of brew for zsh on Ubuntu; gate swift-format on Swift changes so it stops occupying a macOS slot.

Estimate: about 60 runner-minutes per PR down to 35–45 and wall clock about 6–7 min, with less queueing.

Claiming: this issue. First PR measures the Flatpak job's peak disk use (item 1); later items follow as separate commits/PRs, each with before/after timings.

Written with Claude Code (Claude Opus 5.5).

Activity

  1. zackees commented on Oct 13, 2026

    @zackees
    Member

    Heads-up from #436 (maintainer request): Flatpak, the macOS/Windows OBS builds, Ubuntu Rust-libobs and Tier 2 macOS/Windows are moving out of PR and master-push runs into a gate that the daily release requires. appimage.yaml stops running per master push (continuous refreshes from the daily release). Those jobs still run, so caching work still pays off at release time. I'll keep my appimage.yaml edit to the trigger and the publish condition.

  2. zackees commented on Oct 16, 2026

    @zackees
    Member

    Taking over stale claim from @rdoupe
    Item 5 (format jobs): clang-format spends 31 s on brew update + brew install zsh and 43 s installing clang-format-22, then 0.3 s formatting; gersemi is the same shape. Plan: one PR running both through the local gate's pinned uvx tools (uv run ci/local_gate.py --only clang-format|gersemi), the same versions and file sets ./lint uses. Item 2 (the Tier 2 Docker image) is covered by #967 (native Tier 2).

  3. added
    claimed
    on Oct 16, 2026
  4. zackees commented on Oct 16, 2026

    @zackees
    Member

    @rdoupe yout concerns are heard loud and clear.

    For the next session, I am ONLY doing CI speed improvements.

    The biggest improvements are taking expensive dependencies like qt and ffmpeg and recompiling them per platform.

    All the dependencies will be compiled like this.

    The end result will be a full compile that will take a couple of minutes.

    We are choosing glibc 2.28 (many linux) for wide compatibility.

    Then we will precompile deps for mac and windows.

    OS dependencies have been moved to platform specific sub directories.

    If you don't touch files in these sub directors then the platform tests won't run for the PR and you'll be on the fast path.

    The CI latency goal is <4 mins per PR on the fast path.

  5. zackees commented on Oct 16, 2026

    @zackees
    Member

    All six items are done:

    1. Flatpak: moved out of PR/master-push runs into the release gate (ci: Move Flatpak and the native builds out of the dev cycle into a release gate #436); remaining Flatpak time is ci: Flatpak build takes ~17 min; where the time goes #651.
    2. Tier 2 Linux: no image rebuild (stock ubuntu:26.04 container, ci: Run Tier 2 Linux natively on the runner, not in a Docker image built per job (step 1 of #937) #966/ci: Run Tier 2 Linux natively on the runner #967), apt downloads cached (ci: Tier 2 Linux jobs reuse their apt downloads #1058, ci: Fix the Tier 2 apt cache: restore with zstd, save once on master #1077: ~31 s vs 45–63 s per job), build once + 6 balanced shards (ci: Tier 2 Linux builds once and shards the tests #975, ci: Tier 2 test shards run without a Rust toolchain #1044, ci: Balance Tier 2 Linux shards by recorded test duration #1049, ci: Tier 2 Linux shards hand their test timings back #1061).
    3. Tier 2 Windows: ccache + vcpkg binary cache (ci: Tier 2 Windows reuses compiles with ccache and a vcpkg binary cache #1040).
    4. Tier 2 macOS: restores master's Xcode CAS (ci: Tier 2 macOS reuses master's Xcode compilation cache #1089, ci: Tier 2 macOS saves its Xcode cache on scheduled master runs too #1090).
    5. Format jobs: local gate's pinned uvx tools (ci: Format jobs run the local gate's pinned tools #984).
    6. swift-format only on Swift changes; Ubuntu jobs on apt/uv (check-format.yaml).
      PR runs that select no heavy lane now take ~3 min (e.g. run 38891533827).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions