Skip to content

[ci] Add ids workflow for checking llvm apis have been annotated with LLVM_ABI #8

[ci] Add ids workflow for checking llvm apis have been annotated with LLVM_ABI

[ci] Add ids workflow for checking llvm apis have been annotated with LLVM_ABI #8

Workflow file for this run

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@v4
with:
repository: compnerd/ids
path: ${{ github.workspace }}/ids
fetch-depth: 0
- uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/llvm-project
fetch-depth: 0
- name: install dependencies
run: |
brew install llvm@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@18)/bin/clang \
-D CMAKE_CXX_COMPILER=$(brew --prefix llvm@18)/bin/clang++ \
-D CMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \
-D LLVM_DIR=$(brew --prefix llvm@18)lib/cmake/llvm \
-D Clang_DIR=$(brew --prefix llvm@18)/lib/cmake/clang \
-D FILECHECK_EXECUTABLE=$(brew --prefix llvm@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