-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (123 loc) · 4.43 KB
/
docs-validation.yml
File metadata and controls
151 lines (123 loc) · 4.43 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
name: Documentation Validation
on:
pull_request:
paths:
- 'docs/**'
- 'scripts/validar_estructura_docs.sh'
- '.github/workflows/docs-validation.yml'
push:
branches:
- main
- develop
- 'claude/**'
paths:
- 'docs/**'
jobs:
validate-structure:
name: Validate Docs Structure
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Make validation script executable
run: chmod +x scripts/validar_estructura_docs.sh
- name: Run structure validation
run: |
echo "::group::Validating documentation structure"
./scripts/validar_estructura_docs.sh
echo "::endgroup::"
- name: Check validation result
if: failure()
run: |
echo "::error::Documentation structure validation failed"
echo "Please review the errors above and fix them"
exit 1
check-old-references:
name: Check for Old Structure References
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for old structure references
run: bash scripts/validation/docs/check_docs_old_references.sh
check-markdown-links:
name: Check Markdown Links
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install markdown-link-check
run: npm install -g markdown-link-check
- name: Check internal links in critical docs
run: |
echo "::group::Checking internal links"
# Check critical documentation files
CRITICAL_DOCS=(
"docs/README.md"
"docs/backend/README.md"
"docs/frontend/README.md"
"docs/infrastructure/README.md"
"docs/anexos/analisis_nov_2025/RESUMEN_EJECUTIVO_REORGANIZACION.md"
)
ERROR_COUNT=0
for doc in "${CRITICAL_DOCS[@]}"; do
if [ -f "$doc" ]; then
echo "Checking: $doc"
if ! markdown-link-check "$doc" --config .github/markdown-link-check-config.json 2>/dev/null; then
echo "::warning::Broken links found in $doc"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
fi
done
if [ $ERROR_COUNT -gt 0 ]; then
echo "::warning::Found $ERROR_COUNT files with broken links"
echo "Please review and fix broken links"
# Don't fail the build for broken links, just warn
else
echo "[OK] All checked links are valid"
fi
echo "::endgroup::"
continue-on-error: true
validate-auto-generated-docs:
name: Validate Auto-Generated Docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check auto-generated docs metadata
run: bash scripts/validation/docs/validate_autogenerated_docs.sh
count-docs-stats:
name: Documentation Statistics
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate documentation statistics
run: bash scripts/validation/docs/generate_docs_stats.sh
summary:
name: Validation Summary
runs-on: ubuntu-latest
needs: [validate-structure, check-old-references, validate-auto-generated-docs, count-docs-stats]
if: always()
steps:
- name: Check overall status
run: |
echo "::group::Validation Summary"
if [ "${{ needs.validate-structure.result }}" == "success" ] && \
[ "${{ needs.check-old-references.result }}" == "success" ] && \
[ "${{ needs.validate-auto-generated-docs.result }}" == "success" ]; then
echo "[PASS] All documentation validation checks passed!"
echo ""
echo "Documentation structure is valid and consistent."
else
echo "[FAIL] Some documentation validation checks failed"
echo ""
echo "Results:"
echo " - Structure validation: ${{ needs.validate-structure.result }}"
echo " - Old references check: ${{ needs.check-old-references.result }}"
echo " - Auto-generated docs: ${{ needs.validate-auto-generated-docs.result }}"
echo ""
echo "Please review the errors above and fix them before merging."
exit 1
fi
echo "::endgroup::"