[llvm-branch-commits] [llvm] [CI][Github] Add linux premerge workflow (PR #119635)

Aiden Grossman via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 11 16:00:09 PST 2024


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

>From 19f4098c0934f242ed5b332533dfe03c44e82de8 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 11 Dec 2024 23:31:07 +0000
Subject: [PATCH 1/6] [CI][Github] Add linux premerge workflow

This patch adds a Github Actions workflow for Linux premerge. This currently
just calls into the existing CI scripts as a starting point.
---
 .github/workflows/premerge.yaml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 .github/workflows/premerge.yaml

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
new file mode 100644
index 00000000000000..33a5b57ab3548f
--- /dev/null
+++ b/.github/workflows/premerge.yaml
@@ -0,0 +1,20 @@
+name: LLVM Premerge Checks
+
+permissions:
+  contents: read
+
+on:
+  pull_request:
+    paths:
+      - .github/workflows/premerge.yaml
+
+jobs:
+  premerge-checks-linux:
+    if: github.repository_owner == 'llvm'
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout LLVM
+        uses: actions/checkout at v4
+      - name: Build and Test
+        run: |
+          echo test

>From 9c8661960efcbfee9164dcc74bca22c5e30adbc9 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 11 Dec 2024 23:44:30 +0000
Subject: [PATCH 2/6] Modification stuff

---
 .github/workflows/premerge.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 33a5b57ab3548f..e471f0d3aa256c 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -17,4 +17,8 @@ jobs:
         uses: actions/checkout at v4
       - name: Build and Test
         run: |
-          echo test
+          ${MODIFIED_FILES:=$(git diff --name-only HEAD~1...HEAD)}
+          echo $MODIFIED_FILES
+          modified_dirs=$(echo "$MODIFIED_FILES" | cut -d'/' -f1 | sort -u)
+          echo "$modified_dirs" >&2
+

>From 60c621205f3994c7a0b4e34d087bb11f6dbda7f4 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 11 Dec 2024 23:51:04 +0000
Subject: [PATCH 3/6] Adjust depth

---
 .github/workflows/premerge.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index e471f0d3aa256c..632c5ca38a1784 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -15,6 +15,8 @@ jobs:
     steps:
       - name: Checkout LLVM
         uses: actions/checkout at v4
+        with:
+          fetch-depth: 2
       - name: Build and Test
         run: |
           ${MODIFIED_FILES:=$(git diff --name-only HEAD~1...HEAD)}

>From 49b3859a055e7aa788c74e09a438001602fc00c1 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 11 Dec 2024 23:53:31 +0000
Subject: [PATCH 4/6] maybe

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

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 632c5ca38a1784..1964085cbf0cfc 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -22,5 +22,5 @@ jobs:
           ${MODIFIED_FILES:=$(git diff --name-only HEAD~1...HEAD)}
           echo $MODIFIED_FILES
           modified_dirs=$(echo "$MODIFIED_FILES" | cut -d'/' -f1 | sort -u)
-          echo "$modified_dirs" >&2
+          echo "$modified_dirs"
 

>From 41efe71d08fe063f1ee96731ea32f313e6422a1d Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 11 Dec 2024 23:54:41 +0000
Subject: [PATCH 5/6] fix thing

---
 .github/workflows/premerge.yaml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 1964085cbf0cfc..17094574499281 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -19,8 +19,8 @@ jobs:
           fetch-depth: 2
       - name: Build and Test
         run: |
-          ${MODIFIED_FILES:=$(git diff --name-only HEAD~1...HEAD)}
-          echo $MODIFIED_FILES
-          modified_dirs=$(echo "$MODIFIED_FILES" | cut -d'/' -f1 | sort -u)
+          modified_files=$(git diff --name-only HEAD~1...HEAD)
+          echo $modified_files
+          modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
           echo "$modified_dirs"
 

>From cb5cf35c20e40ba461fb0f6f75f0409ce14ec7ad Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 11 Dec 2024 23:59:54 +0000
Subject: [PATCH 6/6] incremental testing

---
 .github/workflows/premerge.yaml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 17094574499281..94b0f97ba49509 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -24,3 +24,16 @@ jobs:
           modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
           echo "$modified_dirs"
 
+          . ./.ci/compute-projects.sh
+
+          all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
+          modified_projects="$(keep-modified-projects ${all_projects})"
+
+          linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects}))
+          linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq)
+          linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)
+
+          linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test})
+          linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq)
+          linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq)
+



More information about the llvm-branch-commits mailing list