[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:23:17 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/9] [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/9] 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/9] 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/9] 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/9] 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/9] 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)
+

>From 43ca65316a18d34a4557281467d2f3baa94d9ecb Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Thu, 12 Dec 2024 00:04:04 +0000
Subject: [PATCH 7/9] Add pipeline

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

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index 94b0f97ba49509..a32847c94a6093 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -20,9 +20,7 @@ jobs:
       - 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)
-          echo "$modified_dirs"
 
           . ./.ci/compute-projects.sh
 
@@ -37,3 +35,9 @@ jobs:
           linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq)
           linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq)
 
+          echo "Building projects: ${linux_projects}"
+          echo "Running project checks targets: ${linux_check_targets}"
+          echo "Building runtimes: ${linux_runtimes}"
+          echo "Running runtimes checks targets: ${linux_runtime_check_targets}"
+
+          ./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"

>From 67b537d6fe00877ffd318e5fe26094d39211be78 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Thu, 12 Dec 2024 00:09:06 +0000
Subject: [PATCH 8/9] Switch container

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

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index a32847c94a6093..e9a4f47428206e 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -12,6 +12,8 @@ jobs:
   premerge-checks-linux:
     if: github.repository_owner == 'llvm'
     runs-on: ubuntu-latest
+    container:
+      image: ghcr.io/llvm/ci-ubuntu-22.04:latest
     steps:
       - name: Checkout LLVM
         uses: actions/checkout at v4

>From 5f4e4517ced8a40ca78368b1eab14a18cc904d00 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Thu, 12 Dec 2024 00:23:04 +0000
Subject: [PATCH 9/9] debugging

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

diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index e9a4f47428206e..ece3483f2284fa 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -21,6 +21,9 @@ jobs:
           fetch-depth: 2
       - name: Build and Test
         run: |
+          ls
+          pwd
+
           modified_files=$(git diff --name-only HEAD~1...HEAD)
           modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
 



More information about the llvm-branch-commits mailing list