Skip to content

Commit 62317a5

Browse files
yyyu-googlecopybara-github
authored andcommitted
test: enable doc gen testing
PiperOrigin-RevId: 834440082
1 parent b333a7c commit 62317a5

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test Docs Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test-docs-build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout 🛎️
13+
uses: actions/checkout@v5
14+
15+
- name: Setup .NET ⚙️
16+
uses: actions/setup-dotnet@v5
17+
with:
18+
dotnet-version: '8.0.x'
19+
20+
- name: Install DocFX 🛠️
21+
run: dotnet tool update -g docfx
22+
23+
- name: Create index.md from README.md
24+
run: cp README.md index.md
25+
26+
- name: Generate DocFx metadata
27+
run: docfx metadata docfx.json
28+
29+
- name: Build Documentation 📖
30+
run: docfx build docfx.json --warningsAsErrors
31+
32+
- name: Verify build output
33+
run: |
34+
if [ ! -d "./_site" ]; then
35+
echo "❌ Error: _site directory not found"
36+
exit 1
37+
fi
38+
39+
# Check if index.html exists (main entry point)
40+
if [ ! -f "./_site/index.html" ]; then
41+
echo "❌ Error: index.html not generated"
42+
exit 1
43+
fi
44+
45+
# Check if any HTML files were generated
46+
html_count=$(find ./_site -name "*.html" | wc -l)
47+
if [ "$html_count" -eq 0 ]; then
48+
echo "❌ Error: No HTML files generated"
49+
exit 1
50+
fi
51+
52+
echo "✅ Documentation built successfully"
53+
echo "📊 Generated $html_count HTML files"

0 commit comments

Comments
 (0)