-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (129 loc) · 5.86 KB
/
docs-check.yml
File metadata and controls
154 lines (129 loc) · 5.86 KB
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
54
55
56
57
58
59
60
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Documentation Checks
# NOTE: This workflow must be kept in sync with the 'docs-check' target in the root Makefile.
# The Makefile "docs-check" target performs the same checks locally.
# When adding or modifying documentation checks, update both this workflow and the Makefile to ensure consistency.
# The workflow runs documentation validation checks in the same order as the root Makefile `docs-check` target:
# - validate-go-code-blocks (python3 scripts/validate_go_code_blocks.py)
# - validate-go-spec-signature-consistency (python3 scripts/validate_go_spec_signature_consistency.py)
# - validate-heading-numbering (python3 scripts/validate_heading_numbering.py)
# - validate-api-go-defs-index (python3 scripts/validate_api_go_defs_index.py)
# - validate-req-references (python3 scripts/validate_req_references.py)
# - audit-coverage (python3 scripts/audit_feature_coverage.py and audit_requirements_coverage.py)
# - validate-links (python3 scripts/validate_links.py)
# - markdown-lint (markdownlint-cli2) (always runs, even if earlier steps fail)
# NOTE: validate-go-signatures is run as part of Go CI (api/go/Makefile ci) to avoid duplicate execution
#
# NOTE: Order matters:
# - validate-go-code-blocks runs first to check code block structure
# - validate-go-spec-signature-consistency runs after code blocks to check signature consistency
# - validate-heading-numbering runs before validate-api-go-defs-index and validate-links
# because fixing heading numbering changes anchor IDs
# - validate-api-go-defs-index runs before validate-links to catch missing definitions early
on:
push:
paths:
- '*.md'
- '**/*.md'
- 'docs/**'
- 'features/**/*.feature'
- 'scripts/validate_*.py'
- 'scripts/audit_*.py'
- 'Makefile'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docs-check:
name: Documentation Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install markdownlint-cli2
run: npm install -g markdownlint-cli2
- name: Create tmp directory
run: mkdir -p tmp
- name: Run Go code blocks validation
run: python3 scripts/validate_go_code_blocks.py --output tmp/go_code_blocks_report.md --verbose
- name: Upload Go code blocks report
if: failure()
uses: actions/upload-artifact@v7
with:
name: go-code-blocks-validation-report
path: tmp/go_code_blocks_report.md
if-no-files-found: ignore
- name: Run Go signature consistency validation
run: python3 scripts/validate_go_spec_signature_consistency.py --output tmp/signature_consistency_report.txt --verbose
- name: Upload signature consistency report
if: failure()
uses: actions/upload-artifact@v7
with:
name: signature-consistency-report
path: tmp/signature_consistency_report.txt
if-no-files-found: ignore
- name: Run heading numbering validation
run: python3 scripts/validate_heading_numbering.py --output tmp/heading_numbering_report.txt --verbose
- name: Upload heading numbering report
if: failure()
uses: actions/upload-artifact@v7
with:
name: heading-numbering-validation-report
path: tmp/heading_numbering_report.txt
if-no-files-found: ignore
- name: Run Go definitions index validation
run: python3 scripts/validate_api_go_defs_index.py --output tmp/go_defs_index_report.txt --verbose
- name: Upload Go definitions index report
if: failure()
uses: actions/upload-artifact@v7
with:
name: go-definitions-index-report
path: tmp/go_defs_index_report.txt
if-no-files-found: ignore
- name: Run requirement reference validation
run: python3 scripts/validate_req_references.py --output tmp/req_references_report.txt --verbose
- name: Upload requirement reference report
if: failure()
uses: actions/upload-artifact@v7
with:
name: requirement-reference-report
path: tmp/req_references_report.txt
if-no-files-found: ignore
- name: Run feature coverage audit
run: python3 scripts/audit_feature_coverage.py --output tmp/feature_coverage_report.txt --verbose
- name: Upload feature coverage report
if: failure()
uses: actions/upload-artifact@v7
with:
name: feature-coverage-report
path: tmp/feature_coverage_report.txt
if-no-files-found: ignore
- name: Run requirements coverage audit
run: python3 scripts/audit_requirements_coverage.py --output tmp/requirements_coverage_report.txt --verbose
- name: Upload requirements coverage report
if: failure()
uses: actions/upload-artifact@v7
with:
name: requirements-coverage-report
path: tmp/requirements_coverage_report.txt
if-no-files-found: ignore
- name: Run link validation
run: python3 scripts/validate_links.py --output tmp/validation_report.txt --verbose
- name: Upload link validation report
if: failure()
uses: actions/upload-artifact@v7
with:
name: link-validation-report
path: tmp/validation_report.txt
if-no-files-found: ignore
- name: Run markdown linting
if: always()
run: NODE_OPTIONS="--no-warnings=MODULE_TYPELESS_PACKAGE_JSON" markdownlint-cli2 "**/*.md" "#tmp/**"