Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

ci: stop building the Tauri Cua Spaces installer bundles on PRs (CUA-2134) (#5818)

Francesco Bonacciceb65a265945
diff --git a/.github/scripts/tests/test_ci_cua_spaces_workflow.py b/.github/scripts/tests/test_ci_cua_spaces_workflow.py
new file mode 100644
index 0000000000..7b1d3324df
--- /dev/null
+++ b/.github/scripts/tests/test_ci_cua_spaces_workflow.py
@@ -0,0 +1,36 @@
+"""The Tauri installer bundles must not build on plain pull requests.
+
+The Tauri app (apps/cua-spaces) is not what ships, and its bundles take 60 to
+100 minutes cold. Pull requests keep the cheap frontend and Rust command-layer
+checks; the bundles build on main, on manual runs and on `ci:full` PRs.
+"""
+
+from pathlib import Path
+
+import yaml
+
+
+ROOT = Path(__file__).resolve().parents[3]
+WORKFLOW = yaml.safe_load((ROOT / ".github/workflows/ci-cua-spaces.yml").read_text())
+JOBS = WORKFLOW["jobs"]
+
+
+def test_bundle_is_skipped_on_plain_pull_requests():
+ condition = JOBS["bundle"]["if"]
+ assert "github.event_name != 'pull_request'" in condition
+ assert "contains(github.event.pull_request.labels.*.name, 'ci:full')" in condition
+ assert JOBS["bundle"]["needs"] == "changes"
+
+
+def test_bundle_still_builds_on_main_and_manual_runs():
+ triggers = WORKFLOW[True]
+ assert triggers["push"]["branches"] == ["main"]
+ assert "workflow_dispatch" in triggers
+
+
+def test_pull_requests_keep_the_cheap_tauri_checks():
+ # `rust` compiles and tests src-tauri; `frontend` runs vitest + typecheck.
+ for name in ("rust", "frontend"):
+ condition = JOBS[name].get("if", "")
+ assert "pull_request" not in condition and "ci:full" not in condition
+ assert "src-tauri/Cargo.toml" in str(JOBS["rust"]["steps"])
diff --git a/.github/workflows/README.md b/.github/workflows/README.md
index af7118b2b7..ccbda51d21 100644
--- a/.github/workflows/README.md
+++ b/.github/workflows/README.md
@@ -14,11 +14,11 @@ exclusive: a change that touches two areas runs both.
| You changed | Workflows that run |
|---|---|
-| `libs/cua/**` (Rust core: SDK, daemon, CLI, spaces crates) | CI: cua SDK (rust lint, rust test, spaces e2e, bindings drift, python/node/browser smoke, kotlin; macOS and Windows legs with the `ci:full` label), CI: Cua Spaces (frontend + bundles), CI: Test Python, CI: openkoalabot-example (TypeScript and Swift, Tauri), CI: infinite-canvas (Swift), CI: cua contrib providers, CI: cua your-cloud providers, CI: Check Docs |
+| `libs/cua/**` (Rust core: SDK, daemon, CLI, spaces crates) | CI: cua SDK (rust lint, rust test, spaces e2e, bindings drift, python/node/browser smoke, kotlin; macOS and Windows legs with the `ci:full` label), CI: Cua Spaces (frontend + Rust tests; installer bundles only with the `ci:full` label), CI: Test Python, CI: openkoalabot-example (TypeScript and Swift, Tauri), CI: infinite-canvas (Swift), CI: cua contrib providers, CI: cua your-cloud providers, CI: Check Docs |
| `libs/cua-spacesd/**` | CI: cua-spacesd (3 OS + relay e2e), CI: Image doctor, CD: Image linux (build and gates only), CI: Images on the current cua-spacesd, openkoalabot (Tauri) |
| `libs/cua-driver/**` | CI: Rust Linux / macOS / Windows unit, CI: Nix Linux Rust source, CI: cua-driver contract clients, driver quick feedback, Image doctor, CI: cua-spacesd |
-| `apps/cua-spaces/src/**` (web frontend only) | CI: Cua Spaces: vitest + typecheck and the Linux bundle. The Windows and macOS bundles run only when something other than `src/`, `public/`, `e2e/`, `tests/`, `docs/` or markdown changed (the web assets are packed identically on every OS) |
-| `apps/cua-spaces/src-tauri/**` or anything native | CI: Cua Spaces with all three bundles |
+| `apps/cua-spaces/src/**` (web frontend only) | CI: Cua Spaces: vitest + typecheck and the Rust command-layer tests. The installer bundles (a Tauri app that does not ship) are not built on pull requests; add the `ci:full` label to build them, and then the Windows and macOS bundles run only when something other than `src/`, `public/`, `e2e/`, `tests/`, `docs/` or markdown changed |
+| `apps/cua-spaces/src-tauri/**` or anything native | CI: Cua Spaces (Rust command-layer tests compile and test the Tauri crate; all three bundles with the `ci:full` label) |
| `apps/cua-spaces-macos/**` | CI: Cua Spaces for macOS (SwiftUI) |
| `apps/cua-spaces-desktop/**` | CI: Cua Spaces web UI and Electron shell |
| `docs/**` | CI: Check Docs Links, Docs: compile lanes, Docs page tests |
@@ -28,7 +28,9 @@ exclusive: a change that touches two areas runs both.
| markdown, comments only | metadata checks only (Release metadata, SPDX, link checks) |
Main runs every workflow above on its own paths too (the Rust ones warm the
-build cache, below), and the nightly schedules cover the rest.
+build cache, below), and the nightly schedules cover the rest. The Cua Spaces
+Tauri installer bundles are the one thing pull requests skip by default: they
+build on main pushes, manual runs and `ci:full` pull requests.
## Required checks
diff --git a/.github/workflows/ci-cua-spaces.yml b/.github/workflows/ci-cua-spaces.yml
index 4d74568e17..8620a2a10c 100644
--- a/.github/workflows/ci-cua-spaces.yml
+++ b/.github/workflows/ci-cua-spaces.yml
@@ -1,16 +1,22 @@
name: "CI: Cua Spaces"
-# Pull-request builds of the Cua Spaces app: frontend tests, the Rust command
-# layer tests, and unsigned installer bundles on the three desktop OSes
-# (macOS dmg, Windows NSIS + MSI, Linux deb + AppImage). No signing or
+# Builds of the Tauri Cua Spaces app (apps/cua-spaces): frontend tests, the
+# Rust command layer tests, and unsigned installer bundles on the three desktop
+# OSes (macOS dmg, Windows NSIS + MSI, Linux deb + AppImage). No signing or
# notarization secrets are used; updater artifacts (which need the updater
# signing key) are turned off with a config override. The signed macOS
# release stays in cd-cua-spaces.yml.
#
-# The installer bundles take 60 to 85 minutes, so a pull request builds them
-# only when it changes something they package (see the `changes` job). Every
-# pull request still runs vitest, typecheck and the Rust command-layer tests
-# (`rust`). A manual run (workflow_dispatch) always builds the bundles.
+# This app is not what ships: stable releases are the SwiftUI app on macOS
+# and the Electron app on Windows and Linux (see cd-cua-spaces.yml). The
+# installer bundles take 60 to 100 minutes cold, so a pull request does not
+# build them. Every pull request still runs vitest, typecheck and the Rust
+# command-layer tests (`rust`), which compile the Tauri crate and test it.
+# The bundles build on every push to main that touches the paths above, on a
+# manual run (workflow_dispatch), and on a pull request that carries the
+# `ci:full` label when it is opened or pushed (add the label, then push or
+# reopen), limited to PRs that change something the bundles package (see the
+# `changes` job).
#
# Installer mode (first-run onboarding preselection) is exercised by the
# bundles themselves:
@@ -193,10 +199,12 @@ jobs:
bundle:
name: bundle (${{ matrix.name }})
# Runs in parallel with frontend (no needs on it). Skipped (reported as
- # skipped, which ci-gate accepts) on pull requests that change nothing the
- # installers package, and on release-please PRs (fast checks only).
+ # skipped, which ci-gate accepts) on pull requests unless they carry the
+ # `ci:full` label and change something the installers package, and on
+ # release-please PRs (fast checks only). Main pushes, manual runs and
+ # `ci:full` PRs build them.
needs: changes
- if: ${{ needs.changes.outputs.bundle == 'true' && !startsWith(github.head_ref, 'release-please--branches--') }}
+ if: ${{ needs.changes.outputs.bundle == 'true' && !startsWith(github.head_ref, 'release-please--branches--') && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:full')) }}
strategy:
fail-fast: false
matrix:
diff --git a/apps/cua-spaces/README.md b/apps/cua-spaces/README.md
index 82dc31d80b..93e4eb4acb 100644
--- a/apps/cua-spaces/README.md
+++ b/apps/cua-spaces/README.md
@@ -112,7 +112,7 @@ links `/usr/local/bin/cua` to the bundled CLI). Releases
(`.github/workflows/cd-cua-spaces.yml`) ship this app for Linux and Windows
only; the macOS release is the SwiftUI app (`apps/cua-spaces-macos`), and
the release .pkg wraps that app.
-`.github/workflows/ci-cua-spaces.yml` builds them unsigned on pull requests. Silent / MDM installs can preselect the first-run choice
+`.github/workflows/ci-cua-spaces.yml` builds them unsigned on pushes to main and on pull requests labelled `ci:full`; other pull requests run the frontend and Rust command-layer tests only. Silent / MDM installs can preselect the first-run choice
(the user still confirms in the app):
| Installer | Flag |