Commit 97590b2
authored
ci: fast docs format check for docs-only PRs (#2028)
Since #1991, docs-only PRs skip the full CI matrix, so nothing
format-checks markdown (`vp check` in cli-e2e-test only runs for code
changes). As suggested in [this
comment](#1991 (comment)),
add a fast `docs-fmt` job that runs `vp fmt --check` when `code-changed
== 'false'`.
How it stays fast (about 15s total on the runner, the check itself is
about 5s for 1,879 files):
- `setup-vp` installs the released Vite+ (`version: latest`, since the
workspace `vite-plus` version can be ahead of the registry) with
`run-install: false`.
- `vp fmt` needs the root `vite.config.ts` to load, and its runtime
`import ... from 'vite-plus'` must resolve. Instead of installing the
whole workspace (which also needs the vite/rolldown subrepo clones), the
job symlinks the released `vite-plus` package out of the global install
into `node_modules/`.
- Checks the whole repo, so root markdown (README, RFCs) is covered too,
matching the `**/*.md` part of the CI skip filter.
Non-blocking as suggested: the job is not listed in the `done` job's
needs.
Verified on this PR by temporarily lifting the skip condition (middle
commits, since ci.yml itself is a code change the job would otherwise
skip here):
- [Failing
run](https://github.com/voidzero-dev/vite-plus/actions/runs/28635962494/job/84922274235)
on an intentionally misformatted canary file
- [Passing
run](https://github.com/voidzero-dev/vite-plus/actions/runs/28636039893/job/84922566220)
after removing it
The final commit restores the `code-changed == 'false'` guard, so the
job is expected to be skipped on this PR itself.1 parent 0af68ff commit 97590b2
1 file changed
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
62 | 89 | | |
63 | 90 | | |
64 | 91 | | |
| |||
0 commit comments