Skip to content

fix(cli): credit inline useLogger().set() and grade an empty scan as … #2593

fix(cli): credit inline useLogger().set() and grade an empty scan as …

fix(cli): credit inline useLogger().set() and grade an empty scan as … #2593

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
TURBO_TELEMETRY_DISABLED: 1
# Fork PRs get no OIDC token, so they fall back to the local cache
IS_INTERNAL: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
TURBO_CACHE: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'remote:rw' || 'local:rw' }}
# Without this, turbo silently treats every package as affected
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
jobs:
quality:
name: Lint & typecheck
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write # remote cache OIDC
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0 # --affected needs history
persist-credentials: false
- parallel:
- name: Set up Turborepo remote cache
if: env.IS_INTERNAL == 'true'
uses: vercel/setup-turborepo-remote-cache-action@49d7b1b46ba4c9251e1977986bfe18336feabc8f # v1.1.0
with:
team: ${{ vars.TURBO_TEAM }}
- name: Set up pnpm and Node
uses: ./.github/actions/setup
# apps/telemetry is left out of typecheck: its drizzle results resolve to
# any on a cold CI checkout, so vue-tsc reports implicit-any on every
# query callback. It never ran here before either. Tracked separately.
- name: Lint
run: pnpm exec turbo run lint --affected
- name: Typecheck
run: pnpm exec turbo run typecheck --affected --filter='!evlog-telemetry'
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
id-token: write # remote cache OIDC
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
persist-credentials: false
- parallel:
- name: Set up Turborepo remote cache
if: env.IS_INTERNAL == 'true'
uses: vercel/setup-turborepo-remote-cache-action@49d7b1b46ba4c9251e1977986bfe18336feabc8f # v1.1.0
with:
team: ${{ vars.TURBO_TEAM }}
- name: Set up pnpm and Node
uses: ./.github/actions/setup
- name: Set up Bun for import regressions
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.4.2
# evlog runs once below, under coverage, which enforces its thresholds
- name: Test workspace
run: pnpm exec turbo run test --affected --filter='!evlog'
# content-lint lives in scripts/, outside the workspace graph, so turbo
# never sees it. Its fixture test is what keeps the content pass honest.
- name: Test content-lint
run: pnpm run content:lint:test
# A ratchet, not a floor: every file this pull request touched has to score
# at least as well as the same file on the base branch, and introduce no
# finding id it did not already carry. A fixed bar would fail a new page
# written at 85 while a page sitting at 60 since last year sails through.
- name: Content did not regress
if: github.event_name == 'pull_request'
run: pnpm run content:lint -- --since origin/${{ github.base_ref }}
# The coverage step bypasses turbo, so it inherits no dist/ from the
# affected graph — on a docs-only change nothing is affected and the
# dist-dependent tests (auto-import types, api-surface) would run
# against a missing build. Prepare it explicitly; the remote cache
# makes this a restore, not a rebuild, when src is untouched.
- name: Prepare evlog dist
run: pnpm exec turbo run dev:prepare --filter=evlog
- name: Test evlog with coverage
run: pnpm --filter evlog run test:coverage
# The sandbox smoke runs every non-interactive CLI command against a real
# app per framework — the end-to-end seam (detect → init → doctor → map →
# baseline) that unit tests cover only piecewise. Gated to changes that
# can affect it, so a docs-only pull request skips the cost.
- name: CLI sandbox smoke
if: github.event_name == 'pull_request'
run: |
if git diff --name-only "origin/${{ github.base_ref }}"...HEAD -- packages/cli scripts/cli-sandbox.mjs | grep -q .; then
node scripts/cli-sandbox.mjs --smoke
else
echo "CLI untouched — smoke skipped"
fi
examples:
name: Build examples
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
id-token: write # remote cache OIDC
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
persist-credentials: false
- parallel:
- name: Set up Turborepo remote cache
if: env.IS_INTERNAL == 'true'
uses: vercel/setup-turborepo-remote-cache-action@49d7b1b46ba4c9251e1977986bfe18336feabc8f # v1.1.0
with:
team: ${{ vars.TURBO_TEAM }}
- name: Set up pnpm and Node
uses: ./.github/actions/setup
# --continue: one broken example must not cancel the others
- name: Build affected examples
run: pnpm exec turbo run build --affected --continue --filter='./examples/*'
publish:
name: Publish preview package
runs-on: ubuntu-latest
timeout-minutes: 15
# Not gated on the other jobs: a preview is most useful while the PR is red
if: github.event_name != 'push' || github.ref == 'refs/heads/main'
permissions:
contents: read
id-token: write # remote cache OIDC
pull-requests: write # pkg-pr-new comments the preview install command
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
persist-credentials: false
- parallel:
- name: Set up Turborepo remote cache
if: env.IS_INTERNAL == 'true'
uses: vercel/setup-turborepo-remote-cache-action@49d7b1b46ba4c9251e1977986bfe18336feabc8f # v1.1.0
with:
team: ${{ vars.TURBO_TEAM }}
- name: Set up pnpm and Node
uses: ./.github/actions/setup
- name: Build packages
run: pnpm run build:package
- name: Publish
run: pnpx pkg-pr-new publish --compact --no-template --pnpm './packages/evlog' './packages/nuxthub' './packages/telemetry' './packages/cli' './packages/signals'
# Single required check, so branch protection survives job renames
ci:
name: ci
runs-on: ubuntu-slim
needs: [quality, test, examples]
if: always()
steps:
- name: Verify every required job succeeded
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1