forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
198 lines (194 loc) · 8.26 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# LLVM Documentation CI
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: "Test documentation build"
permissions:
contents: read
on:
push:
branches:
- 'main'
paths:
- 'llvm/docs/**'
- 'clang/docs/**'
- 'clang/include/clang/Basic/AttrDocs.td'
- 'clang/include/clang/Driver/ClangOptionDocs.td'
- 'clang/include/clang/Basic/DiagnosticDocs.td'
- 'clang-tools-extra/docs/**'
- 'lldb/docs/**'
- 'libunwind/docs/**'
- 'libcxx/docs/**'
- 'libc/docs/**'
- 'lld/docs/**'
- 'openmp/docs/**'
- 'polly/docs/**'
- 'flang/docs/**'
- 'flang/include/flang/Optimizer/Dialect/FIROps.td'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'llvm/docs/**'
- 'clang/docs/**'
- 'clang/include/clang/Basic/AttrDocs.td'
- 'clang/include/clang/Driver/ClangOptionDocs.td'
- 'clang/include/clang/Basic/DiagnosticDocs.td'
- 'clang-tools-extra/docs/**'
- 'lldb/docs/**'
- 'libunwind/docs/**'
- 'libcxx/docs/**'
- 'libc/docs/**'
- 'lld/docs/**'
- 'openmp/docs/**'
- 'polly/docs/**'
- 'flang/docs/**'
- 'flang/include/flang/Optimizer/Dialect/FIROps.td'
- '.github/workflows/docs.yml'
jobs:
check-docs-build:
name: "Test documentation build"
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
steps:
# Don't fetch before checking for file changes to force the file changes
# action to use the Github API in pull requests. If it's a push to a
# branch we can't use the Github API to get the diff, so we need to have
# a local checkout beforehand.
- name: Fetch LLVM sources (Push)
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
with:
fetch-depth: 1
- 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/**'
- 'clang/include/clang/Basic/AttrDocs.td'
- 'clang/include/clang/Driver/ClangOptionDocs.td'
- 'clang/include/clang/Basic/DiagnosticDocs.td'
clang-tools-extra:
- 'clang-tools-extra/docs/**'
lldb:
- 'lldb/docs/**'
libunwind:
- 'libunwind/docs/**'
libcxx:
- 'libcxx/docs/**'
libc:
- 'libc/docs/**'
lld:
- 'lld/docs/**'
openmp:
- 'openmp/docs/**'
polly:
- 'polly/docs/**'
flang:
- 'flang/docs/**'
- 'flang/include/flang/Optimizer/Dialect/FIROps.td'
- name: Fetch LLVM sources (PR)
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Python env
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'llvm/docs/requirements.txt'
- name: Install python dependencies
run: pip install -r llvm/docs/requirements.txt
- name: Install system dependencies
run: |
sudo apt-get update
# swig and graphviz are lldb specific dependencies
sudo apt-get install -y cmake ninja-build swig graphviz
- name: Setup output folder
run: mkdir built-docs
- name: Build LLVM docs
if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
run: |
cmake -B llvm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C llvm-build docs-llvm-html docs-llvm-man
mkdir built-docs/llvm
cp -r llvm-build/docs/* built-docs/llvm/
- name: Build Clang docs
if: steps.docs-changed-subprojects.outputs.clang_any_changed == 'true'
run: |
cmake -B clang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C clang-build docs-clang-html docs-clang-man
mkdir built-docs/clang
cp -r clang-build/docs/* built-docs/clang/
- name: Build clang-tools-extra docs
if: steps.docs-changed-subprojects.outputs.clang-tools-extra_any_changed == 'true'
run: |
cmake -B clang-tools-extra-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C clang-tools-extra-build docs-clang-tools-html docs-clang-tools-man
mkdir built-docs/clang-tools-extra
cp -r clang-tools-extra-build/docs/* built-docs/clang-tools-extra/
- name: Build LLDB docs
if: steps.docs-changed-subprojects.outputs.lldb_any_changed == 'true'
run: |
cmake -B lldb-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C lldb-build docs-lldb-html docs-lldb-man
mkdir built-docs/lldb
cp -r lldb-build/docs/* built-docs/lldb/
- name: Build libunwind docs
if: steps.docs-changed-subprojects.outputs.libunwind_any_changed == 'true'
run: |
cmake -B libunwind-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libunwind-build docs-libunwind-html
mkdir built-docs/libunwind
cp -r libunwind-build/libunwind/docs/* built-docs/libunwind
- name: Build libcxx docs
if: steps.docs-changed-subprojects.outputs.libcxx_any_changed == 'true'
run: |
cmake -B libcxx-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx;libunwind" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libcxx-build docs-libcxx-html
mkdir built-docs/libcxx
cp -r libcxx-build/libcxx/docs/* built-docs/libcxx/
- name: Build libc docs
if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
run: |
cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C libc-build docs-libc-html
mkdir built-docs/libc
cp -r libc-build/libc/docs/* built-docs/libc/
- name: Build LLD docs
if: steps.docs-changed-subprojects.outputs.lld_any_changed == 'true'
run: |
cmake -B lld-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C lld-build docs-lld-html
mkdir built-docs/lld
cp -r lld-build/docs/* built-docs/lld/
- name: Build OpenMP docs
if: steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true'
run: |
cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C openmp-build docs-openmp-html
mkdir built-docs/openmp
cp -r openmp-build/docs/* built-docs/openmp/
- name: Build Polly docs
if: steps.docs-changed-subprojects.outputs.polly_any_changed == 'true'
run: |
cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
mkdir built-docs/polly
cp -r polly-build/docs/* built-docs/polly/
- name: Build Flang docs
if: steps.docs-changed-subprojects.outputs.flang_any_changed == 'true'
run: |
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON ./llvm
TZ=UTC ninja -C flang-build docs-flang-html
mkdir built-docs/flang
cp -r flang-build/docs/* built-docs/flang/
- name: Upload docs
uses: actions/upload-artifact@v4
with:
name: docs-output
path: built-docs/