Skip to content

Commit cffb9df

Browse files
[Github] Add steps to build clang docs to CI (#69550)
Recently, support for building the LLVM documentation within Github actions landed, allowing for easy testing of the docs both pre and post landing. This patch extends that functionality to clang and adds in additional support to the docs Github workflow to only build the docs for the subproject whose documentation has been touched.
1 parent 80b2aac commit cffb9df

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/docs.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ on:
1414
- 'main'
1515
paths:
1616
- 'llvm/docs/**'
17+
- 'clang/docs/**'
1718
pull_request:
1819
paths:
1920
- 'llvm/docs/**'
21+
- 'clang/docs/**'
2022

2123
jobs:
2224
check-docs-build:
@@ -39,10 +41,23 @@ jobs:
3941
run: |
4042
sudo apt-get update
4143
sudo apt-get install -y cmake ninja-build
42-
- name: Build docs
44+
- name: Get subprojects that have doc changes
45+
id: docs-changed-subprojects
46+
uses: tj-actions/changed-files@v39
47+
with:
48+
files_yaml: |
49+
llvm:
50+
- 'llvm/docs/**'
51+
clang:
52+
- 'clang/docs/**'
53+
- name: Build LLVM docs
54+
if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
55+
run: |
56+
cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_HTML=ON -DSPHINX_OUTPUT_MAN=ON ./llvm
57+
TZ=UTC ninja -C llvm-build docs-llvm-html docs-llvm-man
58+
- name: Build Clang docs
59+
if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
4360
run: |
44-
mkdir build
45-
cd build
46-
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_HTML=ON -DSPHINX_OUTPUT_MAN=ON ../llvm
47-
TZ=UTC ninja docs-llvm-html docs-llvm-man
61+
cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_HTML=ON -DSPHINX_OUTPUT_MAN=ON ./llvm
62+
TZ=UTC ninja -C clang-build docs-clang-html docs-clang-man
4863

0 commit comments

Comments
 (0)