06Run on CI
Run the same checks locally and on CI
Write a run once in .vx/workspace.ts. Then you and CI type the same short command:
vx pipeline prSave it
Section titled “Save it”import { defineWorkspace } from '@vzn/vx/config'import { github } from '@vzn/vx-ci'import { bun } from '@vzn/vx-lockfile'
export default defineWorkspace({ plugins: [bun(), github()], pipelines: { pr: { tasks: ['lint', 'test', 'build'], affected: true }, main: { tasks: ['lint', 'test', 'build'] }, },})pr runs lint, test and build only where your branch changed something. main runs them in every project. Run vx lock after the edit.
You can now name a run once and stop retyping its flags.
Preview it
Section titled “Preview it”On a branch, --dry shows what pr would run, and runs nothing:
vx pipeline pr --dry Plan 4 status cache time task run miss — @demo/web#lint affected: packages/web/src/index.ts changed (an input) run miss — @demo/web#test affected: packages/web/src/index.ts changed (an input) cached local — @demo/ui#build run miss — @demo/web#build affected: packages/web/src/index.ts changed (an input)
tasks 4 planned · 1 cache hit (1 local) · 3 would run predicted ~680ms wall · ~1.28s total executionRead the line under each task: it says why the task is in the plan.
Only packages/web changed. @demo/ui#build is listed because web’s build and test need it, and it comes from the cache.
Check yourself Why is @demo/ui#build in the plan, when packages/ui did not change?
@demo/web#build depends on it (^build), so the run needs its output. It did not change, so
the plan reads it from the cache: cached local.
You can now check a pull request’s run before you push it.
Call it on CI
Section titled “Call it on CI”- run: bun vx lock --check- run: > bun vx pipeline ${{ github.event_name == 'pull_request' && 'pr' || 'main' }}The same two steps as the CI page: pr on a pull request, main on a push or merge queue. vx lock --check fails the job when a config changed without vx lock (Keep the lock fresh).
You can now run one command on your machine and get CI’s exact result.
PatternsChange a pipeline for one run
Add a flag
Section titled “Add a flag”A flag you type beats the pipeline’s key. This runs main’s tasks in @demo/web, plus the @demo/ui#build it needs:
vx pipeline main --filter @demo/webPlan without running
Section titled “Plan without running”--dry works on any pipeline. vx pipeline main --dry lists every task and whether the cache holds it.
You can now reuse a saved pipeline for a one-off run.
DetailsWhen vx refuses a pipeline
On main itself, pr has no base to compare with:
✗ vx pipeline --affected has no default on the base branch (main): drop --affected, --all runs every project (the cache skips what did not change), or name the last good commit, --affected=<sha>
--affected is `pipelines.pr.affected` in .vx/workspaceRun main there: the cache still skips what did not change.
A name no pipeline has names the closest one:
✗ vx pipeline no pipeline named prr; pipelines: pr, main
fix vx pipeline prEvery key a pipeline takes: Pipeline keys, and vx pipeline.