Skip to content

Commit 73b8f7b

Browse files
Use Ninja
1 parent eb0fec1 commit 73b8f7b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
- main
66
pull_request:
77
types: [opened, synchronize, reopened]
8+
env:
9+
CLANG_VERSION: 18
810
jobs:
911
build:
1012
name: Build
@@ -15,10 +17,22 @@ jobs:
1517
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1618
- name: Install sonar-scanner
1719
uses: sonarsource/sonarcloud-github-c-cpp@v3
18-
- name: Generate compilation database
20+
- name: Install Ninja
21+
run: |
22+
wget https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
23+
sudo unzip ninja-linux.zip -d /usr/local/bin
24+
- name: Install clang
25+
run: |
26+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ${{env.CLANG_VERSION}}
27+
sudo apt install -y clang-tools-${{env.CLANG_VERSION}} libc++-${{env.CLANG_VERSION}}-dev
28+
- name: Generate compilation database and build
1929
run: |
2030
mkdir build
21-
cmake -S . -B build
31+
cmake -S . -B build -G Ninja \
32+
-DCMAKE_CXX_COMPILER=clang++-${{env.CLANG_VERSION}} \
33+
-DCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS=clang-scan-deps-${{env.CLANG_VERSION}}
34+
# The project needs to be built so the `.modmap` files are generated
35+
cmake --build build --target all
2236
- name: Run sonar-scanner
2337
env:
2438
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)