Commit 2c7c336
improvement(ci): affected-only build, typecheck, and unit tests on PRs
On pull requests, Turbo now scopes build, typecheck, and test tasks to
only packages that changed relative to the base branch — plus their
transitive dependents. On pushes to main/develop, the full suite runs.
Implementation details:
- Fetch the base branch at depth=1 before running Turbo so git can
compute the diff (shallow clone cannot reach origin/main otherwise)
- Use --filter=[origin/<base_ref>]... to scope to affected packages
- Add --filter='!./apps/*' to exclude apps from the package build steps:
Turbo's multiple --filter flags use union semantics, so without the
negation, apps are included as dependents of changed packages and
fail because generated files don't exist at that point in the job
- generate and build:app always run fully — generate is global module
discovery; build:app is required for integration tests downstream
Expected impact on a PR touching 1 module:
build:packages 2m30s → ~5s (17 cache hits + 1 rebuild)
typecheck 2m04s → ~5s (only affected packages)
unit tests 1m17s → ~5s (only affected packages)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f5d5d7d commit 2c7c336
1 file changed
Lines changed: 50 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
55 | 73 | | |
56 | 74 | | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
| 78 | + | |
| 79 | + | |
60 | 80 | | |
61 | 81 | | |
62 | 82 | | |
63 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
64 | 91 | | |
65 | 92 | | |
66 | 93 | | |
| |||
108 | 135 | | |
109 | 136 | | |
110 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
111 | 142 | | |
112 | 143 | | |
113 | 144 | | |
| |||
155 | 186 | | |
156 | 187 | | |
157 | 188 | | |
158 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
159 | 197 | | |
160 | 198 | | |
161 | 199 | | |
162 | 200 | | |
163 | 201 | | |
164 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
165 | 210 | | |
166 | 211 | | |
| 212 | + | |
167 | 213 | | |
168 | 214 | | |
169 | 215 | | |
| |||
0 commit comments