Commit 2296e0b
ci: skip Go jobs and add docs-site build for docs-only PRs (#21045)
## Summary
Sibling of #21028 (which lands the same path-filter on `main`'s
`ci-gate.yml`). When a PR only touches `docs/`, root `llms*.txt`, or
root `*.md`, skip the `linux` and `win` Go test runs (~20-30 min saved
per PR) and instead run a docs-site typecheck/build with the llms.txt
drift + unittest guard.
### How it works
A new fast `changes` job calls `gh api .../pulls/{n}/files` and emits
two outputs:
- `code` — `false` if every changed file is under `docs/`, root
`llms*.txt`, or root `*.md`; otherwise `true`. Defaults to `true` for
`push` / `workflow_dispatch` so nothing is skipped on merge.
- `docs_site` — `true` when any `docs/site/**` file is touched.
`linux` and `win` are gated on `code != 'false'`. A new `docs-site` job
(calling the new reusable `docs-site-build.yml`) runs when `docs_site ==
'true'`.
If the `gh api` call fails, the step exits with code 1 — the gate fails
rather than silently defaulting to skipping jobs.
### What runs when
| PR scope | linux/win | docs-site |
|----------|-----------|-----------|
| Pure code (`*.go`, etc.) | ✅ runs | ⏭️ skipped |
| Mixed code + docs | ✅ runs | ✅ runs |
| Pure docs (`docs/site/**`) | ⏭️ skipped | ✅ runs |
| Pure root-level docs (`llms.txt`, `README.md`) | ⏭️ skipped | ⏭️
skipped |
| `push` to `main` / `release/**` | ✅ runs | ✅ runs |
### File-pattern logic
A PR is **docs-only** (skips Go CI) when every changed file matches:
```
^(docs/|llms[^/]*\.txt$|[^/]*\.md$)
```
i.e. files under `docs/`, root-level `llms*.txt`, or root-level `*.md`.
Nested `.md` files (e.g. `execution/README.md`) still count as code
changes.
### `docs-site-build.yml`
Reusable `workflow_call` leaf that:
1. Sets up Python 3.11 + runs `python3
docs/site/scripts/generate-llms.py --check` and `python3 -m unittest
discover docs/site/scripts -v` (the llms drift guard from #21000)
2. Sets up Node 20 + runs `npm ci`, `npm run typecheck`, `npm run build`
against `docs/site/`
Has a defensive guard that skips silently if `docs/site/package.json`
**or** `docs/site/scripts/generate-llms.py` is absent — covering both
fully absent `docs/site/` and partial migration states.
### Files
| File | Change |
|------|--------|
| `.github/workflows/ci.yml` | Add `permissions: pull-requests: read`,
`changes` job, gate `linux`/`win` with `code != 'false'`, add
`docs-site` job |
| `.github/workflows/docs-site-build.yml` | New reusable workflow
(Python llms guard + Node typecheck/build) |
## Test plan
- [ ] Open a docs-only PR (touch `docs/site/docs/...`) — confirm
`linux`/`win` are skipped and `docs-site` runs
- [ ] Open a mixed PR (one `.go` file + one `.md` file) — confirm both
`linux`/`win` and `docs-site` run
- [ ] Open a pure code PR — confirm `docs-site` is skipped,
`linux`/`win` run
- [ ] Push to `release/3.4` — confirm everything runs (no skipping)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Bloxster <bloxster@proton.me>
Co-authored-by: Gianni <gianni@erigon.dev>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>1 parent 6fdfdb7 commit 2296e0b
2 files changed
Lines changed: 104 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
19 | 58 | | |
| 59 | + | |
20 | 60 | | |
21 | 61 | | |
22 | 62 | | |
23 | | - | |
| 63 | + | |
24 | 64 | | |
25 | 65 | | |
26 | 66 | | |
27 | 67 | | |
28 | | - | |
| 68 | + | |
29 | 69 | | |
30 | 70 | | |
31 | 71 | | |
| |||
84 | 124 | | |
85 | 125 | | |
86 | 126 | | |
| 127 | + | |
87 | 128 | | |
88 | 129 | | |
89 | 130 | | |
90 | | - | |
| 131 | + | |
91 | 132 | | |
92 | 133 | | |
93 | 134 | | |
94 | 135 | | |
95 | | - | |
| 136 | + | |
96 | 137 | | |
97 | 138 | | |
98 | 139 | | |
| |||
124 | 165 | | |
125 | 166 | | |
126 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments