Skip to content

feat(node-ci): composable sharded-Vitest + coverage-merge support for advanced consumers #97

Description

@ArchonVII

Summary

node-ci.yml@v1 is a single serial install → lint → typecheck → test → build job. It serves the common case well but cannot serve consumers that need sharded tests with merged coverage + threshold enforcement.

ArchonVII/pigafetta (see ArchonVII/pigafetta#1558) wants to consolidate onto the shared workflow, but migrating to v1 as written would regress its CI: lose 4-way test sharding (full suite unsharded risks the 25-min timeout / large slowdown), lose coverage-threshold gating, lose the tsc -b tsbuildinfo cache hook, and force branch-protection check-name churn.

Importantly, pigafetta does not need its doc-only fast lane, science-audit gate, or success-aggregation moved upstream — those stay caller-side. GitHub supports a caller matrix job invoking a reusable workflow, and the caller keeps its own change-detection + audit + ci-success aggregator. The genuine gaps are below.

Requested capabilities (a composable v2, or a dedicated vitest-sharded.yml)

  • Configurable shard count input (e.g. test-shards: 4) running vitest run --shard=i/N --reporter=blob.
  • Coverage blob upload + merge across shards (vitest --merge-reports) producing one combined coverage report.
  • Threshold enforcement on the merged coverage (global + per-pattern), e.g. a config-path input, so per-shard runs skip thresholds and the merge job enforces once.
  • Cache hooks — let the caller cache incremental build state (e.g. tsc -b tsbuildinfo) keyed independently of the lockfile.
  • Timeout controls per job.
  • Stable job outputs + check names so a caller's required-check aggregator can depend on them deterministically.

Why composable, not all-in-one

Keep pigafetta-specific change detection (doc-only fast lane), the science-audit drift gate, and the ci-success aggregator in pigafetta. The reusable piece should be the sharded-test + coverage-merge contract only, callable from a caller matrix job. This keeps the shared workflow general while letting the most advanced consumer adopt it without losing capability.

Refs

  • Consumer (parked, blocked on this): ArchonVII/pigafetta#1558
  • Current pigafetta ci.yml: sharded test (1–4) + coverage merge job with VITEST_SKIP_THRESHOLDS gating; separate changes (paths-filter), audit, and ci-success jobs.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions