From a9e72a590fce755a0d1adae72bbc5bd6a73b79e4 Mon Sep 17 00:00:00 2001 From: snekxs <26660858+snekxs@users.noreply.github.com> Date: Tue, 20 Oct 2026 18:27:20 -0600 Subject: [PATCH 1/2] CI: cache the installer build, share the cache with releases, cancel superseded runs --- .github/workflows/build-gpui-windows.yml | 14 +++++++++++++- .github/workflows/release.yml | 10 +++++----- gpui/installer/Cargo.toml | 6 ++++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-gpui-windows.yml b/.github/workflows/build-gpui-windows.yml index 20baf16..a5484f3 100644 --- a/.github/workflows/build-gpui-windows.yml +++ b/.github/workflows/build-gpui-windows.yml @@ -10,6 +10,12 @@ on: branches: [main, gpui] pull_request: +# A newer push to the same branch or PR makes an unfinished build of the older +# one pointless, so cancel it instead of letting them pile up. +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: windows-latest @@ -23,9 +29,15 @@ jobs: - uses: dtolnay/rust-toolchain@stable + # The installer is its own cargo workspace with its own target folder, + # so it needs its own cache entry. `shared-key` lets release.yml reuse + # what this builds. - uses: Swatinem/rust-cache@v2 with: - workspaces: gpui + workspaces: | + gpui + gpui/installer + shared-key: windows # gpui/build.rs bundles the protocol drivers with esbuild, so the root # node_modules must exist first. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 329fdd9..6041ca9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,17 +56,17 @@ jobs: - uses: dtolnay/rust-toolchain@stable + # Same cache the build workflow fills on main, installer included. - uses: Swatinem/rust-cache@v2 with: - workspaces: gpui + workspaces: | + gpui + gpui/installer + shared-key: windows - name: Install JS dependencies run: npm ci - - name: Test - run: cargo test - working-directory: gpui - - name: Build release binary run: cargo build --release working-directory: gpui diff --git a/gpui/installer/Cargo.toml b/gpui/installer/Cargo.toml index f78873e..57d1ac1 100644 --- a/gpui/installer/Cargo.toml +++ b/gpui/installer/Cargo.toml @@ -32,7 +32,9 @@ mslnk = "0.1" [build-dependencies] winres = "0.1" +# No LTO here: the installer is a small dialog, and fat LTO over the whole GPUI +# dependency tree was the slowest step of every build for a few percent of size. [profile.release] -lto = true -codegen-units = 1 +lto = false +codegen-units = 16 strip = true From e72b5c751af709533e5d9df492e6f498de49cd83 Mon Sep 17 00:00:00 2001 From: snekxs <26660858+snekxs@users.noreply.github.com> Date: Tue, 20 Oct 2026 18:43:05 -0600 Subject: [PATCH 2/2] CI: keep main builds running so they fill the cache, and keep tests in the release --- .github/workflows/build-gpui-windows.yml | 6 ++++-- .github/workflows/release.yml | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-gpui-windows.yml b/.github/workflows/build-gpui-windows.yml index a5484f3..0551682 100644 --- a/.github/workflows/build-gpui-windows.yml +++ b/.github/workflows/build-gpui-windows.yml @@ -11,10 +11,12 @@ on: pull_request: # A newer push to the same branch or PR makes an unfinished build of the older -# one pointless, so cancel it instead of letting them pile up. +# one pointless, so cancel it instead of letting them pile up. Never on main: +# those builds are the ones that fill the shared cache, and a cancelled run +# saves nothing. concurrency: group: build-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6041ca9..fc4b4db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,6 +67,12 @@ jobs: - name: Install JS dependencies run: npm ci + # A tag can point at any commit, so don't publish without the tests. + # Cheap now: the shared cache already holds the test build. + - name: Test + run: cargo test + working-directory: gpui + - name: Build release binary run: cargo build --release working-directory: gpui