|
| 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: install dependencies |
| 36 | + run: | |
| 37 | + brew install llvm@18 |
| 38 | + brew install lit |
| 39 | + brew install ninja |
| 40 | +
|
| 41 | + - name: Configure and build minimal LLVM for use by ids |
| 42 | + run: | |
| 43 | + cmake -B ${{ github.workspace }}/llvm-project/build/ \ |
| 44 | + -D CMAKE_BUILD_TYPE=Release \ |
| 45 | + -S ${{ github.workspace }}/llvm-project/llvm/ \ |
| 46 | + -D LLVM_ENABLE_PROJECTS=clang \ |
| 47 | + -D LLVM_TARGETS_TO_BUILD="host" \ |
| 48 | + -G Ninja |
| 49 | + cd ${{ github.workspace }}/llvm-project/build/ |
| 50 | + ninja -t targets all | grep "CommonTableGen: phony$" | grep -v "/" | sed 's/:.*//' |
| 51 | +
|
| 52 | + - name: Configure ids |
| 53 | + run: | |
| 54 | + cmake -B ${{ github.workspace }}/ids/build/ \ |
| 55 | + -S ${{ github.workspace }}/ids/ \ |
| 56 | + -D CMAKE_BUILD_TYPE=Release \ |
| 57 | + -D CMAKE_C_COMPILER=$(brew --prefix llvm@18)/bin/clang \ |
| 58 | + -D CMAKE_CXX_COMPILER=$(brew --prefix llvm@18)/bin/clang++ \ |
| 59 | + -D CMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ |
| 60 | + -D LLVM_DIR=$(brew --prefix llvm@18)/lib/cmake/llvm \ |
| 61 | + -D Clang_DIR=$(brew --prefix llvm@18)/lib/cmake/clang \ |
| 62 | + -D FILECHECK_EXECUTABLE=$(brew --prefix llvm@18)/bin/FileCheck \ |
| 63 | + -D LIT_EXECUTABLE=$(brew --prefix lit)/bin/lit |
| 64 | +
|
| 65 | + - name: Build ids |
| 66 | + run: | |
| 67 | + cmake --build ${{ github.workspace }}/ids/build \ |
| 68 | + --config Release \ |
| 69 | + --parallel $(sysctl -n hw.ncpu) |
| 70 | +
|
| 71 | + - name: Run ids over compilation database |
| 72 | + run: | |
| 73 | + ${{ github.workspace }}/ids/build/bin/idt -p ${{ github.workspace }}/llvm-project/build/compile_commands.json --export-macro LLVM_ABI |
0 commit comments