Skip to content

Commit 7c77918

Browse files
committed
Workflow for triggering sonarqube
1 parent 8868737 commit 7c77918

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
path: src
16+
submodules: 'recursive'
17+
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
18+
- name: Create build directory
19+
run: mkdir build
20+
- name: Run CMake
21+
run: |
22+
docker run --rm \
23+
-v ${{ github.workspace }}/src:/src \
24+
-w /src \
25+
-v ${{ github.workspace }}/build:/build \
26+
--user root \
27+
quay.io/mariadb-foundation/bb-worker:ubuntu24.04 \
28+
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
29+
-DUPDATE_SUBMODULES=OFF \
30+
-DPLUGIN_{MROONGA,ROCKSDB,OQGRAPH,COLUMNSTORE}=NO \
31+
-B /build -S /src
32+
- name: SonarQube Scan
33+
uses: SonarSource/[email protected]
34+
env:
35+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
36+
with:
37+
args: >
38+
--define sonar.cfamily.compile-commands="build/compile_commands.json"
39+
--define sonar.projectKey=grooverdan_mariadb-server
40+
--define sonar.organization=grooverdan
41+
--define sonar.token=${SONAR_TOKEN}
42+
--define sonar.exclusions=storage/mroonga/**/*,storage/rocksdb/**/*,storage/oqgraph/**/*,storage/columnstore/**/*,**/*.java,mysql-test/std_data/**/*,scripts/**/*

0 commit comments

Comments
 (0)