Skip to content

Commit d68a50d

Browse files
committed
Workflow for triggering sonarqube
1 parent 8868737 commit d68a50d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: SonarQube
2+
on:
3+
push:
4+
branches:
5+
- 11.8-sonarqube
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build and analyze
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
path: src
17+
- name: Create build directory
18+
run: mkdir build
19+
- name: Run CMake
20+
run: |
21+
docker run --rm \
22+
-v ${{ github.workspace }}/src:/src \
23+
-w /src \
24+
-v ${{ github.workspace }}/build:/build \
25+
--user root \
26+
quay.io/mariadb-foundation/bb-worker:ubuntu:22.04 \
27+
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build -S src
28+
- name: SonarQube Scan
29+
uses: SonarSource/[email protected]
30+
env:
31+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
32+
with:
33+
args: >
34+
--define sonar.cfamily.compile-commands="build/compile_commands.json"

0 commit comments

Comments
 (0)