[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 13:14:33 PST 2025


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

>From 94be407711b29942ca0b7e21103fdd0bc7912195 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..1eb236909ba4d
--- /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 $(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 42157a1f8ea9fccc8955f7fdc438d385cbc33b96 Mon Sep 17 00:00:00 2001
From: mcbarton <matthew.c.barton at hotmail.co.uk>
Date: Sat, 22 Feb 2025 21:14:24 +0000
Subject: [PATCH 2/2] 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 1eb236909ba4d..d6b1d152d69a2 100644
--- a/.github/workflows/ids-check.yml
+++ b/.github/workflows/ids-check.yml
@@ -66,8 +66,8 @@ jobs:
       run: |
         cmake --build ${{ github.workspace }}/ids/build \
               --config Release \
-              --parallel $(nproc --all)
+              --parallel $(sysctl -n hw.ncpu)
 
     - 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
+        ${{ github.workspace }}/ids/build/bin/idt -export-macro LLVM_ABI -p ${{ github.workspace }}/llvm-project/build/compile_commands.json



More information about the llvm-commits mailing list