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
6 name: "Test documentation build"
18 - 'clang-tools-extra/docs/**'
30 - 'clang-tools-extra/docs/**'
41 name: "Test documentation build"
42 runs-on: ubuntu-latest
44 # Don't fetch before checking for file changes to force the file changes
45 # action to use the Github API in pull requests. If it's a push to a
46 # branch we can't use the Github API to get the diff, so we need to have
47 # a local checkout beforehand.
48 - name: Fetch LLVM sources (Push)
49 if: ${{ github.event_name == 'push' }}
50 uses: actions/checkout@v4
53 - name: Get subprojects that have doc changes
54 id: docs-changed-subprojects
55 uses: tj-actions/changed-files@v39
63 - 'clang-tools-extra/docs/**'
78 - name: Fetch LLVM sources (PR)
79 if: ${{ github.event_name == 'pull_request' }}
80 uses: actions/checkout@v4
83 - name: Setup Python env
84 uses: actions/setup-python@v4
86 python-version: '3.11'
88 cache-dependency-path: 'llvm/docs/requirements.txt'
89 - name: Install python dependencies
90 run: pip install -r llvm/docs/requirements.txt
91 - name: Install system dependencies
94 # swig and graphviz are lldb specific dependencies
95 sudo apt-get install -y cmake ninja-build swig graphviz
96 - name: Build LLVM docs
97 if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
99 cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON ./llvm
100 TZ=UTC ninja -C llvm-build docs-llvm-html docs-llvm-man
101 - name: Build Clang docs
102 if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
104 cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON ./llvm
105 TZ=UTC ninja -C clang-build docs-clang-html docs-clang-man
106 - name: Build clang-tools-extra docs
107 if: steps.docs-changed-subprojects.outputs.clang-tools-extra_any_changed == 'true'
109 cmake -B clang-tools-extra-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_SPHINX=ON ./llvm
110 TZ=UTC ninja -C clang-tools-extra-build docs-clang-tools-html docs-clang-tools-man
111 - name: Build LLDB docs
112 if: steps.docs-changed-subprojects.outputs.lldb_any_changed == 'true'
114 cmake -B lldb-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_SPHINX=ON ./llvm
115 TZ=UTC ninja -C lldb-build docs-lldb-html docs-lldb-man
116 - name: Build libunwind docs
117 if: steps.docs-changed-subprojects.outputs.libunwind_any_changed == 'true'
119 cmake -B libunwind-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
120 TZ=UTC ninja -C libunwind-build docs-libunwind-html
121 - name: Build libcxx docs
122 if: steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true'
124 cmake -B libcxx-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx" -DLLVM_ENABLE_SPHINX=ON ./runtimes
125 TZ=UTC ninja -C libcxx-build docs-libcxx-html
126 - name: Build libc docs
127 if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
129 cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
130 TZ=UTC ninja -C libc-build docs-libc-html
131 - name: Build LLD docs
132 if: steps.docs-changed-subprojects.outputs.lld_any_changed == 'true'
134 cmake -B lld-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_ENABLE_SPHINX=ON ./llvm
135 TZ=UTC ninja -C lld-build docs-lld-html
136 - name: Build OpenMP docs
137 if: steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true'
139 cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_SPHINX=ON ./llvm
140 TZ=UTC ninja -C openmp-build docs-openmp-html
141 - name: Build Polly docs
142 if: steps.docs-changed-subprojects.outputs.polly_any_changed == 'true'
144 cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
145 TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man