[llvm] [CI] Add Github actions job to build LLVM documentation (PR #69269)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 20:56:37 PDT 2023


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/69269

>From 63bb10129164e9b22b4ce626aaaacd0b45132418 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Mon, 16 Oct 2023 17:52:04 -0700
Subject: [PATCH 1/3] [CI] Add Github actions job to build LLVM documentation

---
 .github/workflows/docs.yml | 43 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 .github/workflows/docs.yml

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 000000000000000..d00cfab0ff28671
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,43 @@
+# 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"
+
+on:
+  push:
+    branches:
+      - 'main'
+    paths:
+      - 'llvm/docs/**'
+  pull_request:
+    paths:
+      - 'llvm/docs/**'
+
+jobs:
+  check-docs-build:
+    name: "Test documentation build"
+    runs-on: ubuntu-latest
+    steps:
+      - name: Fetch LLVM sources
+        uses: actions/checkout at v4
+        with:
+          fetch-depth: 2
+      - name: Setup Python env
+        uses: actions/setup-python at v4
+        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: apt-get update && apt-get install -y cmake ninja-build
+      - name: Build docs
+        run: |
+          mkdir build
+          cd 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
+

>From 6acf3638207bf50fa9d7ed3e6da06737fc5087f8 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Mon, 16 Oct 2023 20:51:14 -0700
Subject: [PATCH 2/3] Address reviewer feedback

---
 .github/workflows/docs.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index d00cfab0ff28671..206a50c71b88efb 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -23,7 +23,7 @@ jobs:
       - name: Fetch LLVM sources
         uses: actions/checkout at v4
         with:
-          fetch-depth: 2
+          fetch-depth: 1
       - name: Setup Python env
         uses: actions/setup-python at v4
         with:

>From 53e2198e59b3827b9d1974fc540723ee29032cd3 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Mon, 16 Oct 2023 20:56:25 -0700
Subject: [PATCH 3/3] Restrict CI permissions

---
 .github/workflows/docs.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 206a50c71b88efb..4af4083a77b8e55 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -5,6 +5,9 @@
 
 name: "Test documentation build"
 
+permissions:
+  contents: read
+
 on:
   push:
     branches:



More information about the llvm-commits mailing list