[llvm] [Github] Force files changed step in docs action to use GH API (PR #69763)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 12:52:13 PDT 2023


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/69763

This patch forces the files changed step in the test documentation Github action to use the Github API to look for changed files rather than using the local git history. Using the local git history takes a significant amount of time(~30m with no depth limit, ~10m with a depth limit of 100) while using the GH API is virtually instantaneous. This uses an extra GH API request, but given the frequency that this action runs with, that shouldn't be an issue.

>From 8de66944bfa2a6791225fda68d73fd1775a63119 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Fri, 20 Oct 2023 12:49:56 -0700
Subject: [PATCH] [Github] Force files changed step in docs action to use GH
 API

This patch forces the files changed step in the test documentation
Github action to use the Github API to look for changed files rather
than using the local git history. Using the local git history takes a
significant amount of time(~30m with no depth limit, ~10m with a depth
limit of 100) while using the GH API is virtually instantaneous. This
uses an extra GH API request, but given the frequency that this action
runs with, that shouldn't be an issue.
---
 .github/workflows/docs.yml | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index d58c7d51e0e44ab..0603dfa3df19b21 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -25,6 +25,15 @@ jobs:
     name: "Test documentation build"
     runs-on: ubuntu-latest
     steps:
+      - name: Get subprojects that have doc changes
+        id: docs-changed-subprojects
+        uses: tj-actions/changed-files at v39
+        with:
+          files_yaml: |
+            llvm:
+              - 'llvm/docs/**'
+            clang:
+              - 'clang/docs/**'
       - name: Fetch LLVM sources
         uses: actions/checkout at v4
         with:
@@ -41,15 +50,6 @@ jobs:
         run: |
           sudo apt-get update
           sudo apt-get install -y cmake ninja-build
-      - name: Get subprojects that have doc changes
-        id: docs-changed-subprojects
-        uses: tj-actions/changed-files at v39
-        with:
-          files_yaml: |
-            llvm:
-              - 'llvm/docs/**'
-            clang:
-              - 'clang/docs/**'
       - name: Build LLVM docs
         if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true'
         run: |



More information about the llvm-commits mailing list