-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Github] Add steps to build clang docs to CI #69550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
|
@llvm/pr-subscribers-github-workflow Author: Aiden Grossman (boomanaiden154) ChangesRecently, 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. Full diff: https://github.com/llvm/llvm-project/pull/69550.diff 1 Files Affected:
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 5133309eb8cf948..315f8d59037ef1d 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -14,9 +14,11 @@ on:
- 'main'
paths:
- 'llvm/docs/**'
+ - 'clang/docs/**'
pull_request:
paths:
- 'llvm/docs/**'
+ - 'clang/docs/**'
jobs:
check-docs-build:
@@ -39,10 +41,27 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
- - name: Build docs
+ - name: Get subprojects that have doc changes
+ id: docs-changed-subprojects
+ uses: tj-actions/changed-files@v39
+ with:
+ files_yaml: |
+ llvm:
+ - 'llvm/docs/**'
+ clang:
+ - 'clang/docs/**'
+ - name: Build LLVM docs
+ if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
run: |
- mkdir build
- cd build
+ mkdir llvm-build
+ cd llvm-build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_HTML=ON -DSPHINX_OUTPUT_MAN=ON ../llvm
TZ=UTC ninja docs-llvm-html docs-llvm-man
+ - name: Build Clang docs
+ if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
+ run: |
+ mkdir clang-build
+ cd clang-build
+ cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_OUTPUT_HTML=ON -DSPHINX_OUTPUT_MAN=ON ../llvm
+ TZ=UTC ninja docs-clang-html docs-clang-man
|
|
I've set everything up in the same job for now mostly because it was simple. We can split it into multiple jobs if necessary, but I don't think many patches touch the docs of multiple subprojects, and those that do still won't run into any problems with the job taking too long. From my testing on my fork, building both the LLVM and clang docs takes under 10 minutes, even with clang having to build |
|
This will fix #65725. |
tstellar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you this looks great. LGTM.
|
Thank you for the review! I'll probably post something on discourse soon too to get attention for other subprojects that might want this. |
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.