Skip to content

Commit 8cbaefd

Browse files
committed
Workflow for triggering sonarqube
1 parent 8868737 commit 8cbaefd

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/build.yml

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

0 commit comments

Comments
 (0)