-
Notifications
You must be signed in to change notification settings - Fork 2
206 lines (173 loc) · 5.85 KB
/
docs.yml
File metadata and controls
206 lines (173 loc) · 5.85 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Documentation
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'lex_helper/**'
- '.github/workflows/docs.yml'
pull_request:
branches:
- main
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'lex_helper/**'
- '.github/workflows/docs.yml'
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Quality assurance job - runs on all pushes and PRs
quality-assurance:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv sync --group docs --no-dev
- name: Verify mkdocstrings installation
run: |
uv run python -c "import mkdocstrings; print('✅ mkdocstrings is available')"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y aspell aspell-en libenchant-2-2
- name: Build documentation for testing
run: |
uv run mkdocs build --clean
- name: Run comprehensive documentation quality checks
run: |
echo "Running comprehensive documentation quality checks..."
uv run python scripts/validate-code-examples.py docs/
uv run python scripts/check-links.py ./site
uv run python scripts/check-accessibility.py ./site
uv run python scripts/check-spelling.py docs/ || true # Allow to fail for now
- name: Test pre-commit documentation checks
run: |
# Test the pre-commit script directly with proper environment
uv run python scripts/pre-commit-docs-check.py docs/index.md docs/getting-started/installation.md
- name: Generate QA report
if: always()
run: |
echo "Quality Assurance Summary" > qa-report.md
echo "=========================" >> qa-report.md
echo "" >> qa-report.md
echo "This report summarizes the quality assurance checks run on the documentation." >> qa-report.md
echo "" >> qa-report.md
echo "- ✅ Code examples validated" >> qa-report.md
echo "- ✅ Internal links checked" >> qa-report.md
echo "- ⚠️ External links checked (warnings allowed)" >> qa-report.md
echo "- ✅ Accessibility compliance checked" >> qa-report.md
echo "- ⚠️ Spelling checked (warnings allowed)" >> qa-report.md
- name: Upload QA report
if: always()
uses: actions/upload-artifact@v4
with:
name: qa-report
path: qa-report.md
# Build job
build:
needs: quality-assurance
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv sync --group docs --no-dev
- name: Verify mkdocstrings installation
run: |
uv run python -c "import mkdocstrings; print('✅ mkdocstrings is available')"
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Build documentation
run: |
uv run mkdocs build --clean
- name: Upload documentation artifacts
uses: actions/upload-pages-artifact@v3
with:
path: ./site
# Test job for pull requests
test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv sync --group docs --no-dev
- name: Verify mkdocstrings installation
run: |
uv run python -c "import mkdocstrings; print('✅ mkdocstrings is available')"
- name: Test documentation build
run: |
uv run mkdocs build --clean
- name: Validate code examples
run: |
uv run python scripts/validate-code-examples.py docs/
- name: Check internal links
run: |
uv run python scripts/check-links.py ./site
- name: Check accessibility
run: |
uv run python scripts/check-accessibility.py ./site
- name: Check spelling
run: |
# Install system dependencies for spell checking
sudo apt-get update
sudo apt-get install -y aspell aspell-en libenchant-2-2
uv run python scripts/check-spelling.py docs/ || true # Allow to fail for now
# Deployment job
deploy:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4