Skip to content

Commit ed3d5c0

Browse files
committed
Add ids workflow
1 parent 21b531e commit ed3d5c0

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/ids-check.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: ids-check
2+
on:
3+
pull_request:
4+
branches: [main]
5+
push:
6+
branches: [main]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
name: ${{ matrix.name }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- name: ids-check
21+
os: macos-15
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
repository: compnerd/ids
27+
path: ${{ github.workspace }}/ids
28+
fetch-depth: 0
29+
30+
- uses: actions/checkout@v4
31+
with:
32+
path: ${{ github.workspace }}/llvm-project
33+
fetch-depth: 0
34+
35+
- name: Configure and build minimal LLVM for use by ids
36+
run: |
37+
cmake -B ${{ github.workspace }}/llvm-project/build/ \
38+
-D CMAKE_BUILD_TYPE=Release \
39+
-S ${{ github.workspace }}/llvm-project/llvm/ \
40+
-D LLVM_ENABLE_PROJECTS=clang \
41+
-D LLVM_TARGETS_TO_BUILD="host" \
42+
-G Ninja
43+
cd {{ github.workspace }}/llvm-project/build/
44+
ninja -t targets all | grep "CommonTableGen: phony$" | grep -v "/" | sed 's/:.*//'
45+
46+
- name: install llvm and lit to build ids against
47+
run: |
48+
brew install llvm@18
49+
brew install lit@18
50+
51+
- name: Configure ids
52+
run: |
53+
cmake -B ${{ github.workspace }}/ids/build/ \
54+
-S ${{ github.workspace }}/ids/ \
55+
-D CMAKE_BUILD_TYPE=Release \
56+
-D CMAKE_C_COMPILER=$(brew --prefix llvm@18)/bin/clang \
57+
-D CMAKE_CXX_COMPILER=$(brew --prefix llvm@18)/bin/clang++ \
58+
-D CMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \
59+
-D LLVM_DIR=$(brew --prefix llvm@18)lib/cmake/llvm \
60+
-D Clang_DIR=$(brew --prefix llvm@18)/lib/cmake/clang \
61+
-D FILECHECK_EXECUTABLE=$(brew --prefix llvm@18)/bin/FileCheck \
62+
-D LIT_EXECUTABLE=$(brew --prefix lit@18)/bin/lit
63+
64+
- name: Build ids
65+
run: |
66+
cmake --build ${{ github.workspace }}/ids/build \
67+
--config Release \
68+
--parallel $(nproc --all)
69+
70+
- name: Run ids over compilation database
71+
run: |
72+
${{ github.workspace }}/ids/build/bin/ids -export-macro LLVM_ABI -p ${{ github.workspace }}/llvm-project/build/compile_commands.json

0 commit comments

Comments
 (0)