-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (72 loc) · 2.32 KB
/
example-docs.yml
File metadata and controls
85 lines (72 loc) · 2.32 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
# Example workflow for generating documentation with Stig
# This is a reference implementation that users can copy to their projects
name: Generate Documentation
on:
push:
branches: [main, develop]
paths:
- 'include/**'
- 'src/**'
- 'test/complex/include/**'
pull_request:
branches: [main]
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Zig
uses: mlugg/setup-zig@v2
- name: Build Stig
run: |
zig build -Doptimize=ReleaseFast
./zig-out/bin/stig --version
- name: Generate Documentation (Markdown)
run: |
./zig-out/bin/stig test/complex/include/spatial/*.hpp \
-f markdown \
-o /tmp/docs.md \
--title "Spatial Library API"
- name: Generate Documentation (mdbook)
run: |
./zig-out/bin/stig test/complex/include/spatial/*.hpp \
-f mdbook \
-o /tmp/docs-mdbook \
--title "Spatial Library API"
- name: Generate Documentation (JSON)
run: |
./zig-out/bin/stig test/complex/include/spatial/*.hpp \
-f json \
-o /tmp/docs.json
- name: Generate Documentation (HTML)
run: |
./zig-out/bin/stig test/complex/include/spatial/*.hpp \
-f html \
-o /tmp/docs.html \
--title "Spatial Library API"
- name: Check Coverage
run: |
./zig-out/bin/stig --coverage test/complex/include/spatial/*.hpp
- name: Upload Documentation Artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: |
/tmp/docs.md
/tmp/docs.json
/tmp/docs.html
/tmp/docs-mdbook/
retention-days: 30
# Optional: Deploy to GitHub Pages
# - name: Setup mdbook
# run: |
# cargo install mdbook
# mdbook build /tmp/docs-mdbook
#
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# if: github.ref == 'refs/heads/main'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: /tmp/docs-mdbook/book