@@ -9,16 +9,12 @@ name: 🔥 TinyTorch CI
99# Stage 1: INLINE BUILD
1010# └─ Build package from src/ modules (if this fails, nothing works)
1111#
12- # Stage 2: UNIT TESTS
13- # └─ Test individual module functions
12+ # Stage 2-4: PARALLEL TESTS (all depend on Stage 1 only)
13+ # ├─ Stage 2: UNIT TESTS - Test individual module functions
14+ # ├─ Stage 3: INTEGRATION TESTS - Cross-module validation
15+ # └─ Stage 4: CLI TESTS - Verify CLI commands work correctly
1416#
15- # Stage 3: INTEGRATION TESTS
16- # └─ Cross-module validation
17- #
18- # Stage 4: CLI TESTS
19- # └─ Verify CLI commands work correctly
20- #
21- # Stage 5: E2E TESTS
17+ # Stage 5: E2E TESTS (depends on Stages 2-4 all passing)
2218# └─ Full user journey validation
2319#
2420# Stage 6: RELEASE VALIDATION (runs after all stages pass)
@@ -197,6 +193,7 @@ jobs:
197193
198194 # ===========================================================================
199195 # STAGE 2: UNIT TESTS - Test individual module functions
196+ # Runs in PARALLEL with Stages 3 and 4 (all depend only on Stage 1)
200197 # ===========================================================================
201198 stage-2-unit :
202199 name : 🧪 Stage 2 · Unit Tests
@@ -234,15 +231,16 @@ jobs:
234231
235232 # ===========================================================================
236233 # STAGE 3: INTEGRATION TESTS - Cross-module validation
234+ # Runs in PARALLEL with Stages 2 and 4 (all depend only on Stage 1)
237235 # ===========================================================================
238236 stage-3-integration :
239237 name : 🔗 Stage 3 · Integration
240238 runs-on : ubuntu-latest
241- needs : [configure, stage-2-unit ]
239+ needs : [configure, stage-1-inline ]
242240 if : |
243241 always() &&
244242 needs.configure.outputs.run_integration == 'true' &&
245- (needs.stage-2-unit .result == 'success' || needs.stage-2-unit .result == 'skipped')
243+ (needs.stage-1-inline .result == 'success' || needs.stage-1-inline .result == 'skipped')
246244 timeout-minutes : 15
247245
248246 defaults :
@@ -271,15 +269,16 @@ jobs:
271269
272270 # ===========================================================================
273271 # STAGE 4: CLI TESTS - Verify CLI commands work
272+ # Runs in PARALLEL with Stages 2 and 3 (all depend only on Stage 1)
274273 # ===========================================================================
275274 stage-4-cli :
276275 name : 💻 Stage 4 · CLI Tests
277276 runs-on : ubuntu-latest
278- needs : [configure, stage-3-integration ]
277+ needs : [configure, stage-1-inline ]
279278 if : |
280279 always() &&
281280 needs.configure.outputs.run_cli == 'true' &&
282- (needs.stage-3-integration .result == 'success' || needs.stage-3-integration .result == 'skipped')
281+ (needs.stage-1-inline .result == 'success' || needs.stage-1-inline .result == 'skipped')
283282 timeout-minutes : 10
284283
285284 defaults :
@@ -308,14 +307,17 @@ jobs:
308307
309308 # ===========================================================================
310309 # STAGE 5: E2E TESTS - Full user journey validation
310+ # Depends on Stages 2, 3, and 4 ALL passing (the integration gate)
311311 # ===========================================================================
312312 stage-5-e2e :
313313 name : 🌐 Stage 5 · E2E Tests
314314 runs-on : ubuntu-latest
315- needs : [configure, stage-4-cli]
315+ needs : [configure, stage-2-unit, stage-3-integration, stage- 4-cli]
316316 if : |
317317 always() &&
318318 needs.configure.outputs.run_e2e == 'true' &&
319+ (needs.stage-2-unit.result == 'success' || needs.stage-2-unit.result == 'skipped') &&
320+ (needs.stage-3-integration.result == 'success' || needs.stage-3-integration.result == 'skipped') &&
319321 (needs.stage-4-cli.result == 'success' || needs.stage-4-cli.result == 'skipped')
320322 timeout-minutes : 15
321323
0 commit comments