Skip to content

Commit 769bc43

Browse files
committed
add SonarQube
Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 628799a commit 769bc43

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/sonarqube.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+
- master
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build and analyze
11+
runs-on: ubuntu-latest
12+
env:
13+
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
18+
- name: Dependencies
19+
run: |
20+
sudo apt-get update -y
21+
sudo apt-get install -y apache2-dev libcjose-dev libssl-dev check pkg-config
22+
sudo apt-get install -y libjansson-dev libcurl4-openssl-dev libhiredis-dev libpcre2-dev
23+
- name: Run build-wrapper
24+
run: |
25+
./autogen.sh
26+
./configure
27+
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make clean all
28+
- name: Run sonar-scanner
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
32+
run: |
33+
sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
34+
Can't

sonar-project.properties

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sonar.projectKey=OpenIDC_mod_auth_openidc
2+
sonar.organization=openidc
3+
4+
# This is the name and version displayed in the SonarCloud UI.
5+
#sonar.projectName=mod_auth_openidc
6+
#sonar.projectVersion=1.0
7+
8+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
9+
#sonar.sources=.
10+
11+
# Encoding of the source code. Default is default system encoding
12+
#sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)