[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / .github / workflows / docs.yml
blob9c695e714edd63991718ae3607463293394397ec
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/include/clang/Basic/AttrDocs.td'
19       - 'clang/include/clang/Driver/ClangOptionDocs.td'
20       - 'clang/include/clang/Basic/DiagnosticDocs.td'
21       - 'clang-tools-extra/docs/**'
22       - 'lldb/docs/**'
23       - 'libunwind/docs/**'
24       - 'libcxx/docs/**'
25       - 'libc/docs/**'
26       - 'lld/docs/**'
27       - 'openmp/docs/**'
28       - 'polly/docs/**'
29       - 'flang/docs/**'
30       - 'flang/include/flang/Optimizer/Dialect/FIROps.td'
31   pull_request:
32     paths:
33       - 'llvm/docs/**'
34       - 'clang/docs/**'
35       - 'clang/include/clang/Basic/AttrDocs.td'
36       - 'clang/include/clang/Driver/ClangOptionDocs.td'
37       - 'clang/include/clang/Basic/DiagnosticDocs.td'
38       - 'clang-tools-extra/docs/**'
39       - 'lldb/docs/**'
40       - 'libunwind/docs/**'
41       - 'libcxx/docs/**'
42       - 'libc/docs/**'
43       - 'lld/docs/**'
44       - 'openmp/docs/**'
45       - 'polly/docs/**'
46       - 'flang/docs/**'
47       - 'flang/include/flang/Optimizer/Dialect/FIROps.td'
49 jobs:
50   check-docs-build:
51     name: "Test documentation build"
52     runs-on: ubuntu-latest
53     if: github.repository == 'llvm/llvm-project'
54     steps:
55       # Don't fetch before checking for file changes to force the file changes
56       # action to use the Github API in pull requests. If it's a push to a
57       # branch we can't use the Github API to get the diff, so we need to have
58       # a local checkout beforehand.
59       - name: Fetch LLVM sources (Push)
60         if: ${{ github.event_name == 'push' }}
61         uses: actions/checkout@v4
62         with:
63           fetch-depth: 1
64       - name: Get subprojects that have doc changes
65         id: docs-changed-subprojects
66         uses: tj-actions/changed-files@v39
67         with:
68           files_yaml: |
69             llvm:
70               - 'llvm/docs/**'
71             clang:
72               - 'clang/docs/**'
73               - 'clang/include/clang/Basic/AttrDocs.td'
74               - 'clang/include/clang/Driver/ClangOptionDocs.td'
75               - 'clang/include/clang/Basic/DiagnosticDocs.td'
76             clang-tools-extra:
77               - 'clang-tools-extra/docs/**'
78             lldb:
79               - 'lldb/docs/**'
80             libunwind:
81               - 'libunwind/docs/**'
82             libcxx:
83               - 'libcxx/docs/**'
84             libc:
85               - 'libc/docs/**'
86             lld:
87               - 'lld/docs/**'
88             openmp:
89               - 'openmp/docs/**'
90             polly:
91               - 'polly/docs/**'
92             flang:
93               - 'flang/docs/**'
94               - 'flang/include/flang/Optimizer/Dialect/FIROps.td'
95       - name: Fetch LLVM sources (PR)
96         if: ${{ github.event_name == 'pull_request' }}
97         uses: actions/checkout@v4
98         with:
99           fetch-depth: 1
100       - name: Setup Python env
101         uses: actions/setup-python@v4
102         with:
103           python-version: '3.11'
104           cache: 'pip'
105           cache-dependency-path: 'llvm/docs/requirements.txt'
106       - name: Install python dependencies
107         run: pip install -r llvm/docs/requirements.txt
108       - name: Install system dependencies
109         run: |
110           sudo apt-get update
111           # swig and graphviz are lldb specific dependencies
112           sudo apt-get install -y cmake ninja-build swig graphviz
113       - name: Build LLVM docs
114         if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
115         run: |
116           cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON ./llvm
117           TZ=UTC ninja -C llvm-build docs-llvm-html docs-llvm-man
118       - name: Build Clang docs
119         if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
120         run: |
121           cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON ./llvm
122           TZ=UTC ninja -C clang-build docs-clang-html docs-clang-man
123       - name: Build clang-tools-extra docs
124         if: steps.docs-changed-subprojects.outputs.clang-tools-extra_any_changed == 'true'
125         run: |
126           cmake -B clang-tools-extra-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_SPHINX=ON ./llvm
127           TZ=UTC ninja -C clang-tools-extra-build docs-clang-tools-html docs-clang-tools-man
128       - name: Build LLDB docs
129         if: steps.docs-changed-subprojects.outputs.lldb_any_changed == 'true'
130         run: |
131           cmake -B lldb-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_SPHINX=ON ./llvm
132           TZ=UTC ninja -C lldb-build docs-lldb-html docs-lldb-man
133       - name: Build libunwind docs
134         if: steps.docs-changed-subprojects.outputs.libunwind_any_changed == 'true'
135         run: |
136           cmake -B libunwind-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
137           TZ=UTC ninja -C libunwind-build docs-libunwind-html
138       - name: Build libcxx docs
139         if: steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true'
140         run: |
141           cmake -B libcxx-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx" -DLLVM_ENABLE_SPHINX=ON ./runtimes
142           TZ=UTC ninja -C libcxx-build docs-libcxx-html
143       - name: Build libc docs
144         if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
145         run: |
146           cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
147           TZ=UTC ninja -C libc-build docs-libc-html
148       - name: Build LLD docs
149         if: steps.docs-changed-subprojects.outputs.lld_any_changed == 'true'
150         run: |
151           cmake -B lld-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_ENABLE_SPHINX=ON ./llvm
152           TZ=UTC ninja -C lld-build docs-lld-html
153       - name: Build OpenMP docs
154         if: steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true'
155         run: |
156           cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_SPHINX=ON ./llvm
157           TZ=UTC ninja -C openmp-build docs-openmp-html
158       - name: Build Polly docs
159         if: steps.docs-changed-subprojects.outputs.polly_any_changed == 'true'
160         run: |
161           cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
162           TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
163       - name: Build Flang docs
164         if: steps.docs-changed-subprojects.outputs.flang_any_changed == 'true'
165         # TODO(boomanaiden154): Remove the SPHINX_WARNINGS_AS_ERRORS from the
166         # CMake invocation once the warnings in the flang docs build are fixed.
167         run: |
168           cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF ./llvm
169           TZ=UTC ninja -C flang-build docs-flang-html docs-flang-man