Skip to content

ci: run tests on PRs and before releases#141

Merged
stippi merged 5 commits into
mainfrom
ci/run-tests-on-pr
Jun 21, 2026
Merged

ci: run tests on PRs and before releases#141
stippi merged 5 commits into
mainfrom
ci/run-tests-on-pr

Conversation

@stippi

@stippi stippi commented Jun 20, 2026

Copy link
Copy Markdown
Owner

What

  • Adds a reusable composite action .github/actions/setup-rust that installs the Rust toolchain, sets up cargo caching (Swatinem/rust-cache), and on Linux installs only the system libraries gpui actually needs.
  • build.yml now also triggers on pull_request: [main] and runs two test jobs:
    • test-linuxcargo fmt --check, cargo clippy -D warnings and cargo test for --workspace --exclude ui_gpui (Linux only).
    • test-gpuicargo test -p ui_gpui across Linux, macOS aarch64, macOS x86_64 and Windows.
  • The release-style build matrix now needs: [test-linux, test-gpui] and is skipped on PRs (if: github.event_name != 'pull_request'), so PRs only pay for tests.
  • release.yml gets the same two test jobs, and prepare-version needs both of them — no release is cut on a red workspace.
  • The release build matrix in release.yml also uses the composite action; the inline Linux-deps block is gone.

Why

The previous setup didn't run any tests in CI at all and the inline apt-get list was much larger than necessary. The trimmed list mirrors what zed's CI uses for gpui (wayland / x11-xcb / xkbcommon-x11 / fontconfig / alsa / vulkan loader / openssl / zstd).

Verified locally

  • cargo fmt --all -- --check — OK
  • cargo clippy --workspace --exclude ui_gpui --all-targets --locked -- -D warnings — OK
  • cargo test --workspace --exclude ui_gpui --locked — all green
  • cargo test -p ui_gpui --locked — 67 tests, all green
  • YAML of all three files validated

Notes

  • The release build job is intentionally hidden on PRs (skipped). That's expected; the cross-platform release matrix is too expensive to run on every PR push.
  • The two test jobs in release.yml are structurally identical to those in build.yml (same composite action, same commands), so a green PR run validates the release path too. They will only actually execute when the release workflow is dispatched manually.

stippi added 5 commits June 21, 2026 01:00
- Add reusable composite action .github/actions/setup-rust that installs
  the Rust toolchain, sets up cargo caching, and (only on Linux) installs
  the minimal system libraries gpui needs (wayland, x11-xcb, xkbcommon-x11,
  fontconfig, alsa, vulkan loader, openssl, zstd).
- build.yml: trigger on pull_request:[main] in addition to push:[main].
  Replace the previous single test step with two jobs:
    * test-linux  -- fmt --check, clippy -D warnings and cargo test for
                     the workspace excluding ui_gpui (Linux only).
    * test-gpui   -- cargo test -p ui_gpui across Linux, macOS aarch64,
                     macOS x86_64 and Windows.
  The existing release-style build matrix now needs both test jobs and
  is skipped for pull requests so PRs only pay for tests.
- release.yml: prepend the same two test jobs and make prepare-version
  depend on them so a release is never cut on a red workspace. Also
  switch the release build steps over to the composite action and drop
  the inline Linux-deps block.
- The old, much larger X11/XCB/mesa/xrandr/xinerama/xcursor/xi apt-get
  list is gone; the trimmed list mirrors what zed's CI actually uses
  for gpui.
shell_command and canonical_working_dir are only used inside the
#[cfg(target_os = "macos")] impl that wraps Seatbelt. Without a cfg
gate they trip clippy's dead_code lint on Linux/Windows once the new
CI test job runs there.

Move them under #[cfg(target_os = "macos")] and drop the now-redundant
target_family branches in shell_command (which under that cfg are
always Unix anyway).
GitHub's macos-13 runners (which are the only way to get x86_64) have
very low capacity and the job sat queued for >10 minutes during the
first PR run while the aarch64, Linux and Windows jobs all completed
in 4-8 minutes. Release builds still cover x86_64 macOS via the build
matrix, so we don't lose meaningful coverage by dropping it here.

aarch64 macOS continues to test gpui on the platform that matters
most for the project's primary target.
bail! is only used inside the macOS-only canonical_working_dir helper.
Without a cfg gate the import is unused on Linux/Windows and trips
clippy's unused_imports lint.
clippy::assertions_on_constants flags assert!(true). The placeholder
test exists only to document that the macOS-specific Seatbelt tests
are intentionally skipped on other platforms, so the assertion has
no value -- an empty body with a comment is just as informative.
@stippi stippi merged commit 9c71545 into main Jun 21, 2026
5 checks passed
@stippi stippi deleted the ci/run-tests-on-pr branch June 21, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant