Skip to content

Commit 604d5e4

Browse files
committed
ci: faster Test Core — affected-only PR tests, single spec suite run
- Add workflow-level concurrency (cancel superseded runs), mirroring objectui. - PRs now run 'turbo run test --affected' against the PR base instead of the full 75-package matrix; spec-rooted PRs still fan out to dependents. - Push runs exclude @objectstack/spec from the plain test pass: the coverage step already executes the identical 250-file suite once with coverage. Previously every push ran the whole spec suite twice. Coverage generation and its artifact upload are now push-only. - Drop no-op 'vitest run --passWithNoTests' test scripts from the three packages with zero test files (account, setup, studio) so turbo skips them instead of booting vitest for nothing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0128mspMLGhBrCzww6jmVUaR
1 parent 052e9ba commit 604d5e4

4 files changed

Lines changed: 31 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ on:
88
branches:
99
- main
1010

11+
# Superseded runs on the same PR/branch waste runners and delay feedback;
12+
# cancel them. Push runs to main group by commit ref as well, so an in-flight
13+
# main run is cancelled only by a newer main push.
14+
concurrency:
15+
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
1118
jobs:
1219
filter:
1320
runs-on: ubuntu-latest
@@ -56,6 +63,9 @@ jobs:
5663
steps:
5764
- name: Checkout repository
5865
uses: actions/checkout@v7
66+
with:
67+
# Full history so `turbo --affected` can diff against the PR base.
68+
fetch-depth: 0
5969

6070
- name: Setup Node.js
6171
uses: actions/setup-node@v6
@@ -93,13 +103,29 @@ jobs:
93103
- name: Install dependencies
94104
run: pnpm install --frozen-lockfile
95105

96-
- name: Run all tests
97-
run: pnpm turbo run test
106+
# PRs: only test packages affected by the diff against the PR base.
107+
# spec sits at the root of the dependency graph, so spec-touching PRs
108+
# still run (close to) everything — but the many PRs that don't touch
109+
# spec skip the bulk of the 75-package matrix.
110+
- name: Run affected tests (PR)
111+
if: github.event_name == 'pull_request'
112+
env:
113+
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }}
114+
run: pnpm turbo run test --affected
115+
116+
# Push to main: full run, but exclude spec's plain test task — the
117+
# coverage step below executes the exact same 250-file spec suite once,
118+
# with coverage. Previously the spec suite ran twice per push.
119+
- name: Run all tests (push)
120+
if: github.event_name == 'push'
121+
run: pnpm turbo run test --filter=!@objectstack/spec
98122

99123
- name: Generate coverage report
124+
if: github.event_name == 'push'
100125
run: pnpm --filter @objectstack/spec test:coverage
101126

102127
- name: Upload coverage reports
128+
if: github.event_name == 'push'
103129
uses: actions/upload-artifact@v7
104130
with:
105131
name: coverage-report

packages/apps/account/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
}
1414
},
1515
"scripts": {
16-
"build": "tsup",
17-
"test": "vitest run --passWithNoTests"
16+
"build": "tsup"
1817
},
1918
"dependencies": {
2019
"@objectstack/platform-objects": "workspace:*",

packages/apps/setup/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
}
1414
},
1515
"scripts": {
16-
"build": "tsup",
17-
"test": "vitest run --passWithNoTests"
16+
"build": "tsup"
1817
},
1918
"dependencies": {
2019
"@objectstack/platform-objects": "workspace:*",

packages/apps/studio/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
}
1414
},
1515
"scripts": {
16-
"build": "tsup",
17-
"test": "vitest run --passWithNoTests"
16+
"build": "tsup"
1817
},
1918
"dependencies": {
2019
"@objectstack/platform-objects": "workspace:*",

0 commit comments

Comments
 (0)