diff --git a/.github/workflows/build-gpui-windows.yml b/.github/workflows/build-gpui-windows.yml index 20baf16..0551682 100644 --- a/.github/workflows/build-gpui-windows.yml +++ b/.github/workflows/build-gpui-windows.yml @@ -10,6 +10,14 @@ 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. 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: ${{ github.ref != 'refs/heads/main' }} + jobs: build: runs-on: windows-latest @@ -23,9 +31,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..fc4b4db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,13 +56,19 @@ 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 + # 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 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