[TOSA] Update TOSA Custom Operator attribute names to align with the spec (#71116)
[llvm-project.git] / .github / workflows / docs.yml
blob17b2fbbae7bd5d66bcfcda4bb0e76bc65e097d4f
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"
8 permissions:
9   contents: read
11 on:
12   push:
13     branches:
14       - 'main'
15     paths:
16       - 'llvm/docs/**'
17       - 'clang/docs/**'
18       - 'clang-tools-extra/docs/**'
19       - 'lldb/docs/**'
20       - 'libunwind/docs/**'
21       - 'libcxx/docs/**'
22       - 'libc/docs/**'
23       - 'lld/docs/**'
24       - 'openmp/docs/**'
25       - 'polly/docs/**'
26   pull_request:
27     paths:
28       - 'llvm/docs/**'
29       - 'clang/docs/**'
30       - 'clang-tools-extra/docs/**'
31       - 'lldb/docs/**'
32       - 'libunwind/docs/**'
33       - 'libcxx/docs/**'
34       - 'libc/docs/**'
35       - 'lld/docs/**'
36       - 'openmp/docs/**'
37       - 'polly/docs/**'
39 jobs:
40   check-docs-build:
41     name: "Test documentation build"
42     runs-on: ubuntu-latest
43     steps:
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
51         with:
52           fetch-depth: 1
53       - name: Get subprojects that have doc changes
54         id: docs-changed-subprojects
55         uses: tj-actions/changed-files@v39
56         with:
57           files_yaml: |
58             llvm:
59               - 'llvm/docs/**'
60             clang:
61               - 'clang/docs/**'
62             clang-tools-extra:
63               - 'clang-tools-extra/docs/**'
64             lldb:
65               - 'lldb/docs/**'
66             libunwind:
67               - 'libunwind/docs/**'
68             libcxx:
69               - 'libcxx/docs/**'
70             libc:
71               - 'libc/docs/**'
72             lld:
73               - 'lld/docs/**'
74             openmp:
75               - 'openmp/docs/**'
76             polly:
77               - 'polly/docs/**'
78       - name: Fetch LLVM sources (PR)
79         if: ${{ github.event_name == 'pull_request' }}
80         uses: actions/checkout@v4
81         with:
82           fetch-depth: 1
83       - name: Setup Python env
84         uses: actions/setup-python@v4
85         with:
86           python-version: '3.11'
87           cache: 'pip'
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
92         run: |
93           sudo apt-get update
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'
98         run: |
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'
103         run: |
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'
108         run: |
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'
113         run: |
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'
118         run: |
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'
123         run: |
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'
128         run: |
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'
133         run: |
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'
138         run: |
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'
143         run: |
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