forked from LuisaGroup/LuisaCompute
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (84 loc) · 2.66 KB
/
Copy pathbuild-docs.yml
File metadata and controls
95 lines (84 loc) · 2.66 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
name: build-docs
on:
push:
branches: [ stable, next, main ]
paths:
- 'docs/**'
- 'include/**'
- '.github/workflows/build-docs.yml'
pull_request:
branches: [ stable, next, main ]
paths:
- 'docs/**'
- 'include/**'
- '.github/workflows/build-docs.yml'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y doxygen
python -m pip install --upgrade pip
pip install sphinx sphinx-rtd-theme breathe myst-parser
- name: Build documentation
run: |
# Generate Doxygen XML
doxygen docs/Doxyfile
cd docs
# Create necessary directories
mkdir -p _static
# Build HTML documentation
sphinx-build -b html . _build/html \
-D exclude_patterns='["_build", "Thumbs.db", ".DS_Store", "venv", ".venv", "output"]' \
--keep-going 2>&1 | tee build.log
# Check for actual errors (not warnings)
if grep -E "^ERROR|build failed|exited with error" build.log > /dev/null; then
echo "Documentation build had errors!"
exit 1
fi
echo "Documentation built successfully"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/_build/html
retention-days: 7
- name: Setup Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
uses: actions/configure-pages@v5
- name: Upload to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/html
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-docs
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4