mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
447013b73a
* Run the test suites CI was silently skipping `turbo test` runs a package's tests only if that package declares a `test` script, so a suite can sit in the repo for months without ever running. Four were in that state: @workflow/world (13 files, 160 tests), @workflow/cli (5 / 51), @workflow/nitro (1 / 30), and two files under packages/core/e2e that no workflow named. Wire each one up, and add scripts/check-test-suites-wired.mjs plus a lint job so the next unwired suite fails CI instead of going unnoticed. Fixes #3731 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Drop the changesets and rename the guard job The PR only wires up existing suites and adds a CI check, so there is nothing to release. Rename the job to match its `no-test-overrides` sibling. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
122 lines
3.2 KiB
YAML
122 lines
3.2 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- "!*"
|
|
pull_request:
|
|
|
|
concurrency:
|
|
# Unique group for this workflow and branch
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
biome:
|
|
name: Biome
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
|
|
- name: Setup Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: "pnpm"
|
|
|
|
- name: Install Dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Biome check
|
|
run: pnpm exec biome ci --max-diagnostics=200
|
|
|
|
no-test-overrides:
|
|
name: No Test Overrides
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check WORKFLOW_SERVER_URL_OVERRIDE is empty
|
|
run: |
|
|
# Ensure the test override constant is not accidentally set
|
|
FILE="packages/world-vercel/src/utils.ts"
|
|
if grep -q "const WORKFLOW_SERVER_URL_OVERRIDE = '';" "$FILE"; then
|
|
echo "✓ WORKFLOW_SERVER_URL_OVERRIDE is empty (safe to merge)"
|
|
else
|
|
echo "✗ ERROR: WORKFLOW_SERVER_URL_OVERRIDE is set to a non-empty value!"
|
|
echo " This constant must be empty string before merging to main."
|
|
echo ""
|
|
echo " Current value:"
|
|
grep "const WORKFLOW_SERVER_URL_OVERRIDE" "$FILE" || true
|
|
exit 1
|
|
fi
|
|
|
|
no-unrun-tests:
|
|
name: No Unrun Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
|
|
# `turbo test` only runs a package's tests if that package declares a
|
|
# `test` script, so a suite can exist for months without ever running.
|
|
# See #3731.
|
|
- name: Check every test file is run by turbo test or a CI lane
|
|
run: node scripts/check-no-unrun-tests.mjs
|
|
|
|
scripts-tests:
|
|
name: CI Scripts Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
|
|
- name: Run .github/scripts unit tests
|
|
run: node --test ".github/scripts/**/*.test.js"
|
|
|
|
docs-links:
|
|
name: Docs Links
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
|
|
|
|
- name: Setup Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: "pnpm"
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
|
|
- name: Install Dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Validate docs links
|
|
run: bun ./scripts/lint.ts
|
|
working-directory: docs
|