Files
vue-tui/.github/workflows/ci.yml
T
Yunfei He bdadea0d02 perf(ci): parallelize verification via a vp run.tasks graph
Replace ci.yml's five serial steps with a single `vp run ci` whose graph lives
in vite.config.ts (run.tasks). The vp task runner fans out independent branches
concurrently: fmt and lint start immediately while check:type and the test
suites wait on build (their consumers resolve @vue-tui/runtime from the built
dist/*.d.mts). The wall-clock critical path becomes build -> test:pty instead
of the sum of every check.

Measured cold (no task cache, no prebuilt dist — the real CI condition): the
graph completes in ~41s vs ~60s serial, ~32% faster, with build correctly
fanned out before the type and test branches. `vp run --last-details` (and the
run summary) still pinpoints which sub-task failed.

Also set run.cache=false so neither local nor CI verification depends on any
task-cache replay. The serial `ready` script in package.json is kept for simple
local use.
2026-05-29 16:54:13 +08:00

52 lines
2.0 KiB
YAML

name: CI
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
# Cancel superseded PR runs, but never cancel a push-to-main run, so every
# commit that lands on main gets a completed CI result. github.ref is unique
# per PR (refs/pull/<n>/merge) and per branch (refs/heads/main).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Least privilege: this job only builds, type-checks and tests — it never
# deploys, releases or comments — so read-only contents (for checkout) is all
# GITHUB_TOKEN needs.
permissions:
contents: read
jobs:
ci:
name: Check, build & test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# voidzero-dev/setup-vp installs Node (via `vp env use`), the vp CLI, and
# — because run-install defaults to true — runs `vp install` in the repo
# root, so no separate install step is needed.
# node-version "22.12.0" pins the exact engines.node floor (>=22.12.0)
# so CI fails if code accidentally relies on a newer Node API.
# cache (off by default) caches the pnpm store; auto-detects pnpm-lock.yaml.
- name: Set up Vite+ (vp) and Node
uses: voidzero-dev/setup-vp@v1
with:
node-version: "22.12.0"
cache: true
# `ci` is the parallel verification graph defined in vite.config.ts
# (run.tasks). The vp task runner fans out independent branches
# concurrently — fmt and lint start immediately, while check:type and the
# test suites wait on build (their consumers resolve @vue-tui/runtime from
# the built dist) — so the wall-clock critical path is build -> test:pty
# rather than the sum of every check. On a cache miss this finishes in
# ~40s vs ~60s run serially. `vp run --last-details` (or the run summary)
# shows which sub-task failed when one does.
- name: Verify (vp run ci)
run: vp run ci