2
.github/workflows/test-skip.yml
vendored
2
.github/workflows/test-skip.yml
vendored
@@ -10,6 +10,7 @@ name: Test (skip-noop)
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
|
- next
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'bin/**'
|
- 'bin/**'
|
||||||
@@ -17,7 +18,6 @@ on:
|
|||||||
- 'agents/**'
|
- 'agents/**'
|
||||||
- 'commands/**'
|
- 'commands/**'
|
||||||
- 'hooks/**'
|
- 'hooks/**'
|
||||||
- 'sdk/**'
|
|
||||||
- 'tests/**'
|
- 'tests/**'
|
||||||
- 'scripts/**'
|
- 'scripts/**'
|
||||||
- 'package.json'
|
- 'package.json'
|
||||||
|
|||||||
58
.github/workflows/test.yml
vendored
58
.github/workflows/test.yml
vendored
@@ -3,11 +3,13 @@ name: Tests
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- next
|
||||||
- main
|
- main
|
||||||
- 'release/**'
|
- 'release/**'
|
||||||
- 'hotfix/**'
|
- 'hotfix/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
|
- next
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'bin/**'
|
- 'bin/**'
|
||||||
@@ -15,7 +17,6 @@ on:
|
|||||||
- 'agents/**'
|
- 'agents/**'
|
||||||
- 'commands/**'
|
- 'commands/**'
|
||||||
- 'hooks/**'
|
- 'hooks/**'
|
||||||
- 'sdk/**'
|
|
||||||
- 'tests/**'
|
- 'tests/**'
|
||||||
- 'scripts/**'
|
- 'scripts/**'
|
||||||
- 'package.json'
|
- 'package.json'
|
||||||
@@ -109,12 +110,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# GitHub's `refs/pull/N/merge` is cached against the recorded merge-base.
|
# GitHub's `refs/pull/N/merge` is cached against the recorded merge-base.
|
||||||
# When main advances after a PR is opened, the cache stays stale and CI
|
# Explicitly merge the PR base branch so tests run against the latest target.
|
||||||
# runs against the pre-advance state — hiding bugs that are already fixed
|
- name: Rebase check — merge PR base branch into PR head
|
||||||
# on trunk and surfacing type errors that were introduced and then patched
|
|
||||||
# on main in between. Explicitly merge current origin/main here so tests
|
|
||||||
# always run against the latest trunk.
|
|
||||||
- name: Rebase check — merge origin/main into PR head
|
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
@@ -124,18 +121,19 @@ jobs:
|
|||||||
git config user.email "ci@gsd-redux"
|
git config user.email "ci@gsd-redux"
|
||||||
git config user.name "CI Rebase Check"
|
git config user.name "CI Rebase Check"
|
||||||
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
BASE_BRANCH="${GITHUB_BASE_REF:-main}"
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
if git fetch origin main; then
|
if git fetch origin "$BASE_BRANCH"; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if [ "$attempt" -eq 3 ]; then
|
if [ "$attempt" -eq 3 ]; then
|
||||||
echo "::error::git fetch origin main failed after 3 attempts."
|
echo "::error::git fetch origin $BASE_BRANCH failed after 3 attempts."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep $((attempt * 4))
|
sleep $((attempt * 4))
|
||||||
done
|
done
|
||||||
if ! git merge --no-edit --no-ff origin/main; then
|
if ! git merge --no-edit --no-ff "origin/$BASE_BRANCH"; then
|
||||||
echo "::error::This PR cannot cleanly merge origin/main. Rebase your branch onto current main and push again."
|
echo "::error::This PR cannot cleanly merge origin/$BASE_BRANCH. Rebase your branch onto current $BASE_BRANCH and push again."
|
||||||
echo "::error::Conflicting files:"
|
echo "::error::Conflicting files:"
|
||||||
git diff --name-only --diff-filter=U
|
git diff --name-only --diff-filter=U
|
||||||
git merge --abort
|
git merge --abort
|
||||||
@@ -166,17 +164,6 @@ jobs:
|
|||||||
chmod +x scripts/check-npm-integrity.sh
|
chmod +x scripts/check-npm-integrity.sh
|
||||||
scripts/check-npm-integrity.sh
|
scripts/check-npm-integrity.sh
|
||||||
|
|
||||||
- name: Build SDK dist (required by installer)
|
|
||||||
shell: bash
|
|
||||||
run: npm run build:sdk
|
|
||||||
|
|
||||||
# Seam contract gate: keep manifest -> generated aliases -> registry/CJS adapters aligned.
|
|
||||||
# Run once per workflow on the primary Linux node to avoid redundant matrix cost.
|
|
||||||
- name: SDK seam coverage tests
|
|
||||||
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 24
|
|
||||||
shell: bash
|
|
||||||
run: cd sdk && npx vitest run src/query/command-seam-coverage.test.ts
|
|
||||||
|
|
||||||
# Split lanes (issue #3597). Unit is the fast default lane; integration
|
# Split lanes (issue #3597). Unit is the fast default lane; integration
|
||||||
# and security run alongside it on every PR. `install` and `slow` are
|
# and security run alongside it on every PR. `install` and `slow` are
|
||||||
# skipped on PR CI by design — they run on the weekly windows-compat
|
# skipped on PR CI by design — they run on the weekly windows-compat
|
||||||
@@ -193,20 +180,15 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: npm run test:security
|
run: npm run test:security
|
||||||
|
|
||||||
# Install + slow lanes only on main-branch push (not PR CI) so PRs stay fast.
|
# Full-suite gates run on a single canonical lane to keep matrix cost bounded.
|
||||||
# Windows is excluded from the install lane: `npm install -g <tarball>` runs
|
# This ensures install + slow tests are always executed in PR CI.
|
||||||
# 7× per release-tarball-smoke.install.test.cjs invocation (1× before-hook
|
|
||||||
# + 6× per-test) and each takes 60–90 s on windows-latest (NTFS + Defender),
|
|
||||||
# so the lane alone consumes ~10 min and blows the 15-min job budget after
|
|
||||||
# earlier steps. Linux + macOS coverage stays here; Windows tarball install
|
|
||||||
# coverage is provided by the weekly windows-compat workflow.
|
|
||||||
- name: Run install tests
|
- name: Run install tests
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.os != 'windows-latest'
|
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 24
|
||||||
shell: bash
|
shell: bash
|
||||||
run: npm run test:install
|
run: npm run test:install
|
||||||
|
|
||||||
- name: Run slow tests
|
- name: Run slow tests
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.os != 'windows-latest'
|
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 24
|
||||||
shell: bash
|
shell: bash
|
||||||
run: npm run test:slow
|
run: npm run test:slow
|
||||||
|
|
||||||
@@ -232,7 +214,7 @@ jobs:
|
|||||||
echo "::error::Expected github-hosted runner. RUNNER_ENVIRONMENT=${RUNNER_ENVIRONMENT:-unset}"
|
echo "::error::Expected github-hosted runner. RUNNER_ENVIRONMENT=${RUNNER_ENVIRONMENT:-unset}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- name: Rebase check — merge origin/main into PR head
|
- name: Rebase check — merge PR base branch into PR head
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
@@ -242,18 +224,19 @@ jobs:
|
|||||||
git config user.email "ci@gsd-redux"
|
git config user.email "ci@gsd-redux"
|
||||||
git config user.name "CI Rebase Check"
|
git config user.name "CI Rebase Check"
|
||||||
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
BASE_BRANCH="${GITHUB_BASE_REF:-main}"
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
if git fetch origin main; then
|
if git fetch origin "$BASE_BRANCH"; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if [ "$attempt" -eq 3 ]; then
|
if [ "$attempt" -eq 3 ]; then
|
||||||
echo "::error::git fetch origin main failed after 3 attempts."
|
echo "::error::git fetch origin $BASE_BRANCH failed after 3 attempts."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep $((attempt * 4))
|
sleep $((attempt * 4))
|
||||||
done
|
done
|
||||||
if ! git merge --no-edit --no-ff origin/main; then
|
if ! git merge --no-edit --no-ff "origin/$BASE_BRANCH"; then
|
||||||
echo "::error::This PR cannot cleanly merge origin/main. Rebase your branch onto current main and push again."
|
echo "::error::This PR cannot cleanly merge origin/$BASE_BRANCH. Rebase your branch onto current $BASE_BRANCH and push again."
|
||||||
git merge --abort
|
git merge --abort
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -270,9 +253,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
chmod +x scripts/check-npm-integrity.sh
|
chmod +x scripts/check-npm-integrity.sh
|
||||||
scripts/check-npm-integrity.sh
|
scripts/check-npm-integrity.sh
|
||||||
- name: Build SDK dist
|
|
||||||
shell: bash
|
|
||||||
run: npm run build:sdk
|
|
||||||
- name: Unit coverage
|
- name: Unit coverage
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user