Skip to content

Commit 12a731b

Browse files
[CI] Add Github actions job to build LLVM documentation (#69269)
This patch adds in support for building the LLVM documentation through a Github actions job. This enables catching documentation build failures earlier and also more easily as the job failure will show up directly on pull requests. The job currently only builds the documentation for LLVM, but the plan is to extend it to also build the documentation for other subprojects when appropriate (i.e., the docs files have changed), starting with clang.
1 parent 7bc793a commit 12a731b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# LLVM Documentation CI
2+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3+
# See https://llvm.org/LICENSE.txt for license information.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
name: "Test documentation build"
7+
8+
permissions:
9+
contents: read
10+
11+
on:
12+
push:
13+
branches:
14+
- 'main'
15+
paths:
16+
- 'llvm/docs/**'
17+
pull_request:
18+
paths:
19+
- 'llvm/docs/**'
20+
21+
jobs:
22+
check-docs-build:
23+
name: "Test documentation build"
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Fetch LLVM sources
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 1
30+
- name: Setup Python env
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: '3.11'
34+
cache: 'pip'
35+
cache-dependency-path: 'llvm/docs/requirements.txt'
36+
- name: Install python dependencies
37+
run: pip install -r llvm/docs/requirements.txt
38+
- name: Install system dependencies
39+
run: apt-get update && apt-get install -y cmake ninja-build
40+
- name: Build docs
41+
run: |
42+
mkdir build
43+
cd build
44+
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_HTML=ON -DSPHINX_OUTPUT_MAN=ON ../llvm
45+
TZ=UTC ninja docs-llvm-html docs-llvm-man
46+

0 commit comments

Comments
 (0)