Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
branches:
- main

# Superseded runs on the same PR/branch waste runners and delay feedback;
# cancel them. Push runs to main group by commit ref as well, so an in-flight
# main run is cancelled only by a newer main push.
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
filter:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,6 +63,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
# Full history so `turbo --affected` can diff against the PR base.
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v6
Expand Down Expand Up @@ -93,13 +103,29 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run all tests
run: pnpm turbo run test
# PRs: only test packages affected by the diff against the PR base.
# spec sits at the root of the dependency graph, so spec-touching PRs
# still run (close to) everything — but the many PRs that don't touch
# spec skip the bulk of the 75-package matrix.
- name: Run affected tests (PR)
if: github.event_name == 'pull_request'
env:
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }}
run: pnpm turbo run test --affected

# Push to main: full run, but exclude spec's plain test task — the
# coverage step below executes the exact same 250-file spec suite once,
# with coverage. Previously the spec suite ran twice per push.
- name: Run all tests (push)
if: github.event_name == 'push'
run: pnpm turbo run test --filter=!@objectstack/spec

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

- name: Upload coverage reports
if: github.event_name == 'push'
uses: actions/upload-artifact@v7
with:
name: coverage-report
Expand Down
3 changes: 1 addition & 2 deletions packages/apps/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
}
},
"scripts": {
"build": "tsup",
"test": "vitest run --passWithNoTests"
"build": "tsup"
},
"dependencies": {
"@objectstack/platform-objects": "workspace:*",
Expand Down
3 changes: 1 addition & 2 deletions packages/apps/setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
}
},
"scripts": {
"build": "tsup",
"test": "vitest run --passWithNoTests"
"build": "tsup"
},
"dependencies": {
"@objectstack/platform-objects": "workspace:*",
Expand Down
3 changes: 1 addition & 2 deletions packages/apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
}
},
"scripts": {
"build": "tsup",
"test": "vitest run --passWithNoTests"
"build": "tsup"
},
"dependencies": {
"@objectstack/platform-objects": "workspace:*",
Expand Down
Loading