[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
Sat Feb 22 12:53:44 PST 2025


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

>From f27fab70194f759fa0f7cb8f6fdab8a7e0044106 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 1/2] 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..a45f4ce7b0d28
--- /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 needed to build ids
+      run: |
+        brew install llvm at 18
+        brew install lit at 18
+        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 at 18)/bin/lit
+
+    - name: Build ids
+      run: |
+        cmake --build ${{ github.workspace }}/ids/build \
+              --config Release \
+              --parallel $(nproc --all)
+
+    - name: Run ids over compilation database
+      run: |
+        ${{ github.workspace }}/ids/build/bin/ids -export-macro LLVM_ABI -p ${{ github.workspace }}/llvm-project/build/compile_commands.json

>From 89fea51b81eb4564e399e76b0028c18def8793db Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sat, 22 Feb 2025 20:53:35 +0000
Subject: [PATCH 2/2] Update ids-check.yml

---
 .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 a45f4ce7b0d28..70f23fd286f1e 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -32,10 +32,10 @@ jobs:
         path: ${{ github.workspace }}/llvm-project
         fetch-depth: 0
 
-    - name: install dependencies needed to build ids
+    - name: install dependencies
       run: |
         brew install llvm at 18
-        brew install lit at 18
+        brew install lit
         brew install ninja
 
     - name: Configure and build minimal LLVM for use by ids
@@ -60,7 +60,7 @@ jobs:
                -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 at 18)/bin/lit
+               -D LIT_EXECUTABLE=$(brew --prefix lit)/bin/lit
 
     - name: Build ids
       run: |



More information about the llvm-commits mailing list