[llvm] [ci] Add ids workflow for checking llvm apis have been annotated with LLVM_ABI (PR #128370)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 11 13:07:43 PDT 2025


https://github.com/mcbarton updated https://github.com/llvm/llvm-project/pull/128370

>From faec30cfc2f64e1d3850c6ddaa87629ccae357d5 Mon Sep 17 00:00:00 2001
From: mcbarton <150042563+mcbarton at users.noreply.github.com>
Date: Tue, 7 Jan 2025 09:06:17 +0000
Subject: [PATCH 01/18] Add ids workflow

---
 .github/workflows/ids-check.yml | 73 +++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 .github/workflows/ids-check.yml

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
new file mode 100644
index 0000000000000..d96be8df6e5c5
--- /dev/null
+++ b/.github/workflows/ids-check.yml
@@ -0,0 +1,73 @@
+name: ids-check
+on:
+  pull_request:
+    branches: [main]
+  push:
+    branches: [main]
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
+  cancel-in-progress: true
+
+jobs:
+  build:
+    name: ${{ matrix.name }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: ids-check
+            os: macos-15
+
+    steps:
+    - uses: actions/checkout at v4
+      with:
+        repository: compnerd/ids
+        path: ${{ github.workspace }}/ids
+        fetch-depth: 0
+
+    - uses: actions/checkout at v4
+      with:
+        path: ${{ github.workspace }}/llvm-project
+        fetch-depth: 0
+
+    - name: install dependencies
+      run: |
+        brew install llvm at 18
+        brew install lit
+        brew install ninja
+
+    - name: Configure and build minimal LLVM for use by ids
+      run: |
+        cmake -B ${{ github.workspace }}/llvm-project/build/ \
+              -D CMAKE_BUILD_TYPE=Release \
+              -S ${{ github.workspace }}/llvm-project/llvm/ \
+              -D LLVM_ENABLE_PROJECTS=clang \
+              -D LLVM_TARGETS_TO_BUILD="host" \
+              -G Ninja
+        cd ${{ github.workspace }}/llvm-project/build/
+        ninja -t targets all | grep "CommonTableGen: phony$" | grep -v "/" | sed 's/:.*//'
+
+    - name: Configure ids
+      run: |
+        cmake -B ${{ github.workspace }}/ids/build/ \
+              -S ${{ github.workspace }}/ids/ \
+               -D CMAKE_BUILD_TYPE=Release \
+               -D CMAKE_C_COMPILER=$(brew --prefix llvm at 18)/bin/clang \
+               -D CMAKE_CXX_COMPILER=$(brew --prefix llvm at 18)/bin/clang++ \
+               -D CMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \
+               -D LLVM_DIR=$(brew --prefix llvm at 18)/lib/cmake/llvm \
+               -D Clang_DIR=$(brew --prefix llvm at 18)/lib/cmake/clang \
+               -D FILECHECK_EXECUTABLE=$(brew --prefix llvm at 18)/bin/FileCheck \
+               -D LIT_EXECUTABLE=$(brew --prefix lit)/bin/lit
+
+    - name: Build ids
+      run: |
+        cmake --build ${{ github.workspace }}/ids/build \
+              --config Release \
+              --parallel $(sysctl -n hw.ncpu)
+
+    - name: Run ids over compilation database
+      run: |
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro LLVM_ABI

>From 0e9ecda504e67d75276eaa4d13e93ccf1d8c95d8 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sun, 23 Feb 2025 13:52:36 +0000
Subject: [PATCH 02/18] Debug

---
 .github/workflows/ids-check.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index d96be8df6e5c5..084b318e00f99 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -45,6 +45,7 @@ jobs:
               -S ${{ github.workspace }}/llvm-project/llvm/ \
               -D LLVM_ENABLE_PROJECTS=clang \
               -D LLVM_TARGETS_TO_BUILD="host" \
+              -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
               -G Ninja
         cd ${{ github.workspace }}/llvm-project/build/
         ninja -t targets all | grep "CommonTableGen: phony$" | grep -v "/" | sed 's/:.*//'
@@ -70,4 +71,5 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro LLVM_ABI
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build --export-macro LLVM_ABI || true
+        ${{ github.workspace }}/ids/build/bin/idt --help

>From 6766315728df28fcc410cd454c9bf9bc0248f756 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sun, 23 Feb 2025 14:02:17 +0000
Subject: [PATCH 03/18] Update ids-check.yml

---
 .github/workflows/ids-check.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index 084b318e00f99..37e638bd7c008 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,5 +71,5 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build --export-macro LLVM_ABI || true
-        ${{ github.workspace }}/ids/build/bin/idt --help
+        LLVM_BUILD_PATH="${{ github.workspace }}/llvm-project/build/"
+        ${{ github.workspace }}/ids/build/bin/idt -p $LLVM_BUILD_PATH --export-macro=LLVM_ABI

>From 436a2b9cf5381a17813199085ce1abffb82ead21 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sun, 23 Feb 2025 14:15:56 +0000
Subject: [PATCH 04/18] Update ids-check.yml

---
 .github/workflows/ids-check.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index 37e638bd7c008..b364ce7aee121 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,5 +71,4 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        LLVM_BUILD_PATH="${{ github.workspace }}/llvm-project/build/"
-        ${{ github.workspace }}/ids/build/bin/idt -p $LLVM_BUILD_PATH --export-macro=LLVM_ABI
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/ -export-macro LLVM_ABI

>From acf11539ca3c8abfea040e9d62d713f2385ac601 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sun, 23 Feb 2025 15:15:32 +0000
Subject: [PATCH 05/18] Update ids-check.yml

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index b364ce7aee121..cc7d065eb5139 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,4 +71,4 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/ -export-macro LLVM_ABI
+        ${{ github.workspace }}/ids/build/bin/idt -p=${{ github.workspace }}/llvm-project/build/ --export-macro=LLVM_ABI

>From 1b0d261913f4a0f5d8b31e876c68df6d59d13153 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sun, 23 Feb 2025 15:52:35 +0000
Subject: [PATCH 06/18] Update ids-check.yml

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index cc7d065eb5139..94a011f050964 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,4 +71,4 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p=${{ github.workspace }}/llvm-project/build/ --export-macro=LLVM_ABI
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/ --export-macro=LLVM_ABI ${{ github.workspace }}/llvm-project/build/

>From 669aec870586c3d3d9a7568bb9d99c0e0276737a Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sun, 23 Feb 2025 16:16:21 +0000
Subject: [PATCH 07/18] Update ids-check.yml

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index 94a011f050964..24ddaefee7561 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,4 +71,4 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/ --export-macro=LLVM_ABI ${{ github.workspace }}/llvm-project/build/
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/ --export-macro=LLVM_ABI ${{ github.workspace }}/llvm-project/

>From 2fba05433d07338d286a28ba2321ef3739feb87c Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sun, 23 Feb 2025 16:32:46 +0000
Subject: [PATCH 08/18] Update ids-check.yml

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index 24ddaefee7561..8470b6bb1b346 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,4 +71,4 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/ --export-macro=LLVM_ABI ${{ github.workspace }}/llvm-project/
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/ --export-macro=LLVM_ABI ${{ github.workspace }}/llvm-project/build/compile_commands.json

>From 9f8be4ab5482d2392352a0f90ca101c9dde41090 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Fri, 28 Feb 2025 20:07:56 +0000
Subject: [PATCH 09/18] Update ids-check.yml

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index 8470b6bb1b346..c39e96eeaee4b 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,4 +71,4 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/ --export-macro=LLVM_ABI ${{ github.workspace }}/llvm-project/build/compile_commands.json
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI ${{ github.workspace }}/llvm-project/build/compile_commands.json

>From ac0c2bfb9db600a85cf4740f2d1edad35f6697da Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Fri, 28 Feb 2025 21:07:29 +0000
Subject: [PATCH 10/18] Update ids-check.yml

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index c39e96eeaee4b..2bd1a0ff0548b 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,4 +71,4 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI ${{ github.workspace }}/llvm-project/build/compile_commands.json
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI

>From fedac3cde8ba35693c31be169ece7735c2ffdf29 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Tue, 11 Mar 2025 17:43:47 +0000
Subject: [PATCH 11/18] Try PR suggestion and switch to Ubuntu runner

---
 .github/workflows/ids-check.yml | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index 2bd1a0ff0548b..df5ed0e8865f6 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -18,7 +18,7 @@ jobs:
       matrix:
         include:
           - name: ids-check
-            os: macos-15
+            os: ubuntu-24.04
 
     steps:
     - uses: actions/checkout at v4
@@ -34,9 +34,8 @@ jobs:
 
     - name: install dependencies
       run: |
-        brew install llvm at 18
-        brew install lit
-        brew install ninja
+        sudo apt install -y clang-18 ninja-build
+        pip install lit
 
     - name: Configure and build minimal LLVM for use by ids
       run: |
@@ -58,10 +57,10 @@ jobs:
                -D CMAKE_C_COMPILER=$(brew --prefix llvm at 18)/bin/clang \
                -D CMAKE_CXX_COMPILER=$(brew --prefix llvm at 18)/bin/clang++ \
                -D CMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \
-               -D LLVM_DIR=$(brew --prefix llvm at 18)/lib/cmake/llvm \
-               -D Clang_DIR=$(brew --prefix llvm at 18)/lib/cmake/clang \
-               -D FILECHECK_EXECUTABLE=$(brew --prefix llvm at 18)/bin/FileCheck \
-               -D LIT_EXECUTABLE=$(brew --prefix lit)/bin/lit
+               -D LLVM_DIR=/usr/lib/llvm-18/lib/cmake/llvm/ \
+               -D Clang_DIR=/usr/lib/llvm-18/lib/cmake/clang/ \
+               -D FILECHECK_EXECUTABLE=$(which FileCheck-18) \
+               -D LIT_EXECUTABLE=$(which lit)
 
     - name: Build ids
       run: |
@@ -71,4 +70,4 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI $(git diff --name-only HEAD~1 HEAD)

>From 284e29cd09dcac0e8627f8870dbec5156d1e5aaf Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Tue, 11 Mar 2025 18:02:24 +0000
Subject: [PATCH 12/18] Install clang libraries

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index df5ed0e8865f6..e2f91a5d54280 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -34,7 +34,7 @@ jobs:
 
     - name: install dependencies
       run: |
-        sudo apt install -y clang-18 ninja-build
+        sudo apt install -y clang-18 ninja-build libclang-18-dev
         pip install lit
 
     - name: Configure and build minimal LLVM for use by ids

>From b483dc47a965a2b14c3bfbb99fe43e6f24c5347a Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Tue, 11 Mar 2025 18:26:42 +0000
Subject: [PATCH 13/18] Remove reference to brew and clone more commits

---
 .github/workflows/ids-check.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index e2f91a5d54280..dc48703691eb9 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -30,7 +30,7 @@ jobs:
     - uses: actions/checkout at v4
       with:
         path: ${{ github.workspace }}/llvm-project
-        fetch-depth: 0
+        fetch-depth: 1
 
     - name: install dependencies
       run: |
@@ -54,8 +54,8 @@ jobs:
         cmake -B ${{ github.workspace }}/ids/build/ \
               -S ${{ github.workspace }}/ids/ \
                -D CMAKE_BUILD_TYPE=Release \
-               -D CMAKE_C_COMPILER=$(brew --prefix llvm at 18)/bin/clang \
-               -D CMAKE_CXX_COMPILER=$(brew --prefix llvm at 18)/bin/clang++ \
+               -D CMAKE_C_COMPILER=clang \
+               -D CMAKE_CXX_COMPILER=clang++ \
                -D CMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \
                -D LLVM_DIR=/usr/lib/llvm-18/lib/cmake/llvm/ \
                -D Clang_DIR=/usr/lib/llvm-18/lib/cmake/clang/ \

>From 983f611599462b66c22741c74060a6fea2d758cf Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Tue, 11 Mar 2025 18:53:40 +0000
Subject: [PATCH 14/18] Increase fetch depth llvm-project checkout

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index dc48703691eb9..d3e1a29ea6b5a 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -30,7 +30,7 @@ jobs:
     - uses: actions/checkout at v4
       with:
         path: ${{ github.workspace }}/llvm-project
-        fetch-depth: 1
+        fetch-depth: 2
 
     - name: install dependencies
       run: |

>From 3f0066d075fb2437159eb78e3d455422b2768f10 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Tue, 11 Mar 2025 18:57:34 +0000
Subject: [PATCH 15/18] Fix number of cpus now on Ubuntu

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index d3e1a29ea6b5a..9a1451510429e 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -66,7 +66,7 @@ jobs:
       run: |
         cmake --build ${{ github.workspace }}/ids/build \
               --config Release \
-              --parallel $(sysctl -n hw.ncpu)
+              --parallel $(nproc --all)
 
     - name: Run ids over compilation database
       run: |

>From 40816eca1a1c2967ae18c9bcaff6a24c822f4260 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Tue, 11 Mar 2025 19:05:39 +0000
Subject: [PATCH 16/18] cd into llvm-project directory (needed for git diff
 command I believe)

---
 .github/workflows/ids-check.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index 9a1451510429e..13ff4932f78e5 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -70,4 +70,5 @@ jobs:
 
     - name: Run ids over compilation database
       run: |
+        cd ${{ github.workspace }}/llvm-project
         ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI $(git diff --name-only HEAD~1 HEAD)

>From bd0f21b0bf4d7d4743f8d9b6174d8f1df4e446de Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Tue, 11 Mar 2025 19:59:50 +0000
Subject: [PATCH 17/18] Only show diff based on file extensions

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

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index 13ff4932f78e5..a9ea2d8ca3950 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,4 +71,4 @@ jobs:
     - name: Run ids over compilation database
       run: |
         cd ${{ github.workspace }}/llvm-project
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI $(git diff --name-only HEAD~1 HEAD)
+        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI $(git diff --name-only HEAD~1 HEAD -- '*.cpp' '*.h')

>From 5fc7292fb2c58587753466e4b96892913a9cc15c Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Tue, 11 Mar 2025 20:07:26 +0000
Subject: [PATCH 18/18] Update ids-check.yml

---
 .github/workflows/ids-check.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/ids-check.yml b/.github/workflows/ids-check.yml
index a9ea2d8ca3950..07de9c111b43b 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -71,4 +71,7 @@ jobs:
     - name: Run ids over compilation database
       run: |
         cd ${{ github.workspace }}/llvm-project
-        ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI $(git diff --name-only HEAD~1 HEAD -- '*.cpp' '*.h')
+        export H_OR_CPP_FILES_CHANGED_LAST_COMMIT=$(git diff --name-only HEAD~1 HEAD -- '*.cpp' '*.h')
+        if [ -z "${H_OR_CPP_FILES_CHANGED_LAST_COMMIT}" ]; then
+          ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro=LLVM_ABI $(git diff --name-only HEAD~1 HEAD -- '*.cpp' '*.h')
+        fi



More information about the llvm-commits mailing list