-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (121 loc) Β· 4.64 KB
/
docs-authority.yml
File metadata and controls
140 lines (121 loc) Β· 4.64 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
name: Documentation Authority CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch: # Manual trigger
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday at midnight UTC
jobs:
build_and_validate_docs:
name: Build & Validate Documentation
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: π₯ Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for accurate change detection
- name: π Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: π¦ Install dependencies
run: |
python -m pip install --upgrade pip
# Add any Python dependencies here if needed
# pip install -r requirements.txt
- name: π¨ Run documentation build script
run: |
python scripts/build-llms-docs.py
continue-on-error: false
- name: β
Validate llms-full.txt generation
run: |
if [ ! -f llms-full.txt ]; then
echo "β Error: llms-full.txt was not generated"
exit 1
fi
FILE_SIZE=$(wc -c < llms-full.txt)
LINE_COUNT=$(wc -l < llms-full.txt)
echo "β llms-full.txt generated successfully"
echo "π File size: $FILE_SIZE bytes"
echo "π Line count: $LINE_COUNT lines"
# Validate minimum content
if [ $LINE_COUNT -lt 100 ]; then
echo "β οΈ Warning: llms-full.txt has fewer than 100 lines"
echo "This might indicate missing documentation or build errors"
exit 1
fi
- name: π Check for required documentation files
run: |
REQUIRED_DOCS=(
"components/docs/DOC_POLICY.md"
"components/docs/SECURITY.md"
"components/docs/FRAMEWORK.md"
"components/docs/API_REFERENCE.md"
"components/docs/ARCHITECTURE.md"
)
MISSING=0
for doc in "${REQUIRED_DOCS[@]}"; do
if [ ! -f "$doc" ]; then
echo "β Missing required documentation: $doc"
MISSING=$((MISSING + 1))
else
echo "β Found: $doc"
fi
done
if [ $MISSING -gt 0 ]; then
echo "β οΈ $MISSING required documentation file(s) missing"
exit 1
fi
- name: π Generate documentation statistics
run: |
echo "## Documentation Statistics" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Total Markdown Files:** $(find components/docs -name '*.md' | wc -l)" >> $GITHUB_STEP_SUMMARY
echo "- **llms-full.txt Size:** $(wc -c < llms-full.txt) bytes" >> $GITHUB_STEP_SUMMARY
echo "- **Total Lines:** $(wc -l < llms-full.txt) lines" >> $GITHUB_STEP_SUMMARY
echo "- **Build Date:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_STEP_SUMMARY
- name: π€ Upload llms-full.txt as artifact
uses: actions/upload-artifact@v4
with:
name: llms-full-documentation-${{ github.sha }}
path: llms-full.txt
retention-days: 30
if-no-files-found: error
- name: π― Comment on PR (if applicable)
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const fileSize = fs.statSync('llms-full.txt').size;
const lineCount = fs.readFileSync('llms-full.txt', 'utf8').split('\n').length;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## π Documentation Build Results\n\n` +
`β
Documentation successfully built and validated!\n\n` +
`- **Output Size:** ${(fileSize / 1024).toFixed(1)} KB\n` +
`- **Total Lines:** ${lineCount.toLocaleString()}\n` +
`- **Build Time:** ${new Date().toISOString()}\n\n` +
`The \`llms-full.txt\` artifact is available in the workflow run.`
});
- name: π Commit updated llms-full.txt (optional)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
if [ -n "$(git status --porcelain llms-full.txt)" ]; then
git add llms-full.txt
git commit -m "docs: auto-update llms-full.txt [skip ci]"
git push
else
echo "No changes to llms-full.txt"
fi