Files
CommaBotandDarkSky 7404fe34dc ci: scope desktop and server jobs on pull requests (#15923)
Build & Test runs about 60 jobs and ~417 job-minutes for every pull
request, and GitHub-hosted runners for the org run at most 60 jobs at a
time, 5 of them on macOS. With twenty-odd open pull requests the macOS
and Windows jobs queue for hours.

On `pull_request` events only:
- `Build AFFiNE native` for macOS/Windows and the macOS/Windows `Desktop
Test` entries run only when the change touches the desktop app, native
code, nbstore, Rust/toolchain files, `package.json`/`yarn.lock` or CI
config. The Linux `Desktop Test` always runs.
- `Server Test` (4 shards), the Elasticsearch, Embedded and Manticore
server tests and `Server E2E Test` run only when the change touches
`packages/backend`, `packages/common`, `tools`, Rust/toolchain files,
`package.json`/`yarn.lock` or CI config. `Build Server native` still
runs because the cloud E2E tests need it.

Pushes and `merge_group` runs are unchanged and run every job. Skipped
jobs report `skipped`, which `3, 2, 1 Launch` already accepts (the
mobile and Rust filters work the same way).

Also:
- Every job has a `timeout-minutes` (60; 90 for the Windows native and
iOS builds), so a step that hangs no longer holds a runner for the
default 6 hours.
- `build-rust` no longer sets `CARGO_INCREMENTAL: '1'` on the toolchain
step. That only stopped `dtolnay/rust-toolchain` from exporting
`CARGO_INCREMENTAL=0`.

For a web/editor-only pull request this drops 4 macOS jobs, 3 Windows
jobs and 11 server test jobs, roughly 200 job-minutes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Chores**
* Pull requests now run desktop and server checks only when their
corresponding files change. Other event types continue to run both
scopes.
* Desktop checks select platforms based on the pull request’s changes;
macOS and Windows native builds run only for desktop-scoped changes.
* Added time limits to most build and test jobs, with longer limits for
iOS and Windows native builds.
  * The final test status now also waits for change-scope evaluation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: DarkSky <darksky2048@gmail.com>
2026-11-24 12:15:57 +08:00
..
2023-04-02 05:52:21 -05:00