-
Notifications
You must be signed in to change notification settings - Fork 5
38 lines (38 loc) · 1.39 KB
/
build.yml
File metadata and controls
38 lines (38 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
env:
CLANG_VERSION: 18
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install clang
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ${{env.CLANG_VERSION}}
sudo apt install -y clang-tools-${{env.CLANG_VERSION}} libc++-${{env.CLANG_VERSION}}-dev
- name: Generate compilation database and build
run: |
mkdir build
cmake -S . -B build -G Ninja \
-DCMAKE_CXX_COMPILER=clang++-${{env.CLANG_VERSION}} \
-DCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS=clang-scan-deps-${{env.CLANG_VERSION}}
# The project needs to be built so the `.modmap` files are generated
cmake --build build --target all
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} # Put the name of your token here
with:
# Set the property "sonar.cfamily.compile-commands" to the compilation database file
args: >
--define sonar.cfamily.compile-commands=build/compile_commands.json