Skip to content

Commit 336d1c3

Browse files
committed
ci(workflows): add docs-only CI fast path
Add a dedicated `docs-lint` workflow that runs markdownlint and cspell via the internal linter binary for every push and pull request. Add `paths-ignore` rules to the four heavyweight workflows (testing, os-compatibility, db-compatibility, db-benchmarking) so they are skipped when every changed file is documentation (*.md or project-words.txt). Mixed pull requests (docs + code) still run the full CI matrix. The path policy is documented in workflow comments and cross-referenced from docs-lint.yaml to the four updated workflows. Closes torrust#1743
1 parent 9d4e4a6 commit 336d1c3

5 files changed

Lines changed: 93 additions & 0 deletions

File tree

.github/workflows/db-benchmarking.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: Database Benchmarking
22

3+
# Path policy: skip this workflow when every changed file is documentation.
4+
# See .github/workflows/docs-lint.yaml for the lightweight docs-only workflow.
35
on:
46
push:
7+
paths-ignore:
8+
- "**/*.md"
9+
- "project-words.txt"
510
pull_request:
11+
paths-ignore:
12+
- "**/*.md"
13+
- "project-words.txt"
614

715
env:
816
CARGO_TERM_COLOR: always

.github/workflows/db-compatibility.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: Database Compatibility
22

3+
# Path policy: skip this workflow when every changed file is documentation.
4+
# See .github/workflows/docs-lint.yaml for the lightweight docs-only workflow.
35
on:
46
push:
7+
paths-ignore:
8+
- "**/*.md"
9+
- "project-words.txt"
510
pull_request:
11+
paths-ignore:
12+
- "**/*.md"
13+
- "project-words.txt"
614

715
env:
816
CARGO_TERM_COLOR: always

.github/workflows/docs-lint.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Docs-Lint Workflow
2+
#
3+
# Runs lightweight documentation checks on every push and pull request.
4+
# Serves as the required CI signal for documentation-only pull requests,
5+
# which are excluded from the heavyweight test and compatibility workflows
6+
# via `paths-ignore` rules in those workflows.
7+
#
8+
# "Docs-only" path policy (mirrored in the `paths-ignore` lists of
9+
# testing.yaml, os-compatibility.yaml, db-compatibility.yaml, and
10+
# db-benchmarking.yaml):
11+
# - **/*.md — all Markdown files (docs/, READMEs, AGENTS.md, SKILL.md, …)
12+
# - project-words.txt — spell-check dictionary (documentation artefact)
13+
#
14+
# A pull request is treated as docs-only when every changed file matches
15+
# one of the patterns above. Mixed pull requests (docs + code) still run
16+
# the full CI matrix because the code-side changes escape `paths-ignore`.
17+
18+
name: Docs Lint
19+
20+
on:
21+
push:
22+
pull_request:
23+
24+
jobs:
25+
docs:
26+
name: Docs Lint
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 10
29+
30+
steps:
31+
- id: checkout
32+
name: Checkout Repository
33+
uses: actions/checkout@v6
34+
35+
- id: setup
36+
name: Setup Toolchain
37+
uses: dtolnay/rust-toolchain@stable
38+
with:
39+
toolchain: stable
40+
41+
- id: node
42+
name: Setup Node.js
43+
uses: actions/setup-node@v6
44+
with:
45+
node-version: "20"
46+
47+
- id: cache
48+
name: Enable Job Cache
49+
uses: Swatinem/rust-cache@v2
50+
51+
- id: linter
52+
name: Install Internal Linter
53+
run: cargo install --locked --git https://github.com/torrust/torrust-linting --bin linter
54+
55+
- id: lint-markdown
56+
name: Lint Markdown
57+
run: linter markdown
58+
59+
- id: lint-spelling
60+
name: Check Spelling
61+
run: linter cspell

.github/workflows/os-compatibility.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: OS Compatibility
22

3+
# Path policy: skip this workflow when every changed file is documentation.
4+
# See .github/workflows/docs-lint.yaml for the lightweight docs-only workflow.
35
on:
46
push:
7+
paths-ignore:
8+
- "**/*.md"
9+
- "project-words.txt"
510
pull_request:
11+
paths-ignore:
12+
- "**/*.md"
13+
- "project-words.txt"
614

715
env:
816
CARGO_TERM_COLOR: always

.github/workflows/testing.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: Testing
22

3+
# Path policy: skip this workflow when every changed file is documentation.
4+
# See .github/workflows/docs-lint.yaml for the lightweight docs-only workflow.
35
on:
46
push:
7+
paths-ignore:
8+
- "**/*.md"
9+
- "project-words.txt"
510
pull_request:
11+
paths-ignore:
12+
- "**/*.md"
13+
- "project-words.txt"
614

715
env:
816
CARGO_TERM_COLOR: always

0 commit comments

Comments
 (0)