-
-
Notifications
You must be signed in to change notification settings - Fork 0
188 lines (167 loc) · 5.59 KB
/
docs.yml
File metadata and controls
188 lines (167 loc) · 5.59 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
# Documentation Validation Workflow
#
# Validates documentation quality and link integrity.
# Runs on documentation changes and periodically to catch stale links.
#
# Jobs:
# 1. markdown-lint - Check Markdown formatting
# 2. link-check - Validate internal and external links
# 3. spell-check - Check for common spelling errors
name: Documentation
on:
push:
branches: [main, develop]
paths:
- 'docs/**'
- '*.md'
- '.github/workflows/docs.yml'
pull_request:
branches: [main]
paths:
- 'docs/**'
- '*.md'
schedule:
# Run weekly to catch stale external links
- cron: '0 6 * * 1'
workflow_dispatch:
jobs:
#############################################################################
# Markdown Linting
#############################################################################
markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: markdownlint
uses: DavidAnson/markdownlint-cli2-action@v22
with:
globs: |
**/*.md
!target/**
!node_modules/**
continue-on-error: true
#############################################################################
# Link Checking
#############################################################################
link-check:
name: Link Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check for broken links
uses: lycheeverse/lychee-action@v2
with:
args: >-
--verbose
--no-progress
--accept 200,204,301,302,403,429
--exclude-mail
--exclude '^https://github\.com/.*/(commit|compare)/'
--exclude '^https://crates\.io/crates/'
--exclude '^https://docs\.rs/'
--exclude 'localhost'
--exclude '127\.0\.0\.1'
--exclude '\.local$'
--timeout 30
--max-retries 3
--max-concurrency 10
'./**/*.md'
'./README.md'
fail: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload link check report
uses: actions/upload-artifact@v6
if: always()
with:
name: link-check-report
path: ./lychee/out.md
retention-days: 30
#############################################################################
# Documentation Build Verification
#############################################################################
doc-build:
name: Documentation Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install system dependencies (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install -y libglib2.0-dev libwebkit2gtk-4.1-dev librsvg2-dev patchelf libgtk-3-dev libayatana-appindicator3-dev libsqlcipher-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-docs-
${{ runner.os }}-cargo-
- name: Build documentation
run: cargo doc --workspace --no-deps --exclude wraith-transfer
env:
RUSTDOCFLAGS: -Dwarnings
- name: Check for missing documentation
run: |
# Count documented vs undocumented items
echo "Checking documentation coverage..."
cargo doc --workspace --no-deps --exclude wraith-transfer 2>&1 | grep -c "warning: missing documentation" || echo "0 missing documentation warnings"
#############################################################################
# Table of Contents Validation
#############################################################################
toc-check:
name: Table of Contents Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Verify documentation structure
run: |
echo "Checking documentation structure..."
# Required top-level docs
required_docs=(
"README.md"
"CHANGELOG.md"
"CONTRIBUTING.md"
"SECURITY.md"
"LICENSE"
)
missing=0
for doc in "${required_docs[@]}"; do
if [[ ! -f "$doc" ]]; then
echo "::error::Missing required file: $doc"
missing=$((missing + 1))
else
echo "Found: $doc"
fi
done
# Check docs directory structure
required_dirs=(
"docs/architecture"
"docs/security"
"docs/technical"
)
for dir in "${required_dirs[@]}"; do
if [[ ! -d "$dir" ]]; then
echo "::warning::Missing docs directory: $dir"
else
echo "Found: $dir/"
fi
done
if [[ $missing -gt 0 ]]; then
exit 1
fi
- name: Count documentation files
run: |
echo "Documentation statistics:"
echo "========================="
echo "Markdown files: $(find . -name '*.md' -not -path './target/*' | wc -l)"
echo "Total lines: $(find . -name '*.md' -not -path './target/*' -exec cat {} + | wc -l)"
echo ""
echo "By directory:"
find docs -type f -name '*.md' | cut -d/ -f2 | sort | uniq -c | sort -rn