[llvm] [Github] Add steps to build clang docs to CI (PR #69550)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 19:02:05 PDT 2023


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/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.

>From a26f62deee8c4d9e5dd67fd4b09ec8f8d80a1384 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Wed, 18 Oct 2023 18:29:14 -0700
Subject: [PATCH] [Github] Add steps to build clang docs to CI

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.
---
 .github/workflows/docs.yml | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

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 at 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
 



More information about the llvm-commits mailing list