Skip to content

Commit 5328e18

Browse files
authoredMar 31, 2023
added sonarqube configuration (#13)
Signed-off-by: nikhil2611 <nikhilgupta2102@gmail.com>
1 parent f02b40c commit 5328e18

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
 

‎.github/workflows/sonarqube.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: SonarQube scan
2+
on:
3+
# Trigger analysis when pushing to your main branches, and when creating a pull request.
4+
push:
5+
branches:
6+
- main # or the name of your main branch
7+
- develop
8+
- 'release/**'
9+
pull_request:
10+
types: [opened, synchronize, reopened]
11+
12+
jobs:
13+
sonarqube:
14+
runs-on: ip-range-controlled
15+
# runs-on: ubuntu-latest
16+
# needs: [build]
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
# Disabling shallow clone is recommended for improving relevancy of reporting
21+
fetch-depth: 0
22+
- name: SonarQube Scan
23+
uses: sonarsource/sonarqube-scan-action@master
24+
env:
25+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
26+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
27+
# If you wish to fail your job when the Quality Gate is red, uncomment the
28+
# following lines. This would typically be used to fail a deployment.
29+
# We do not recommend to use this in a pull request. Prefer using pull request
30+
# decoration instead.
31+
# - uses: sonarsource/sonarqube-quality-gate-action@master
32+
# timeout-minutes: 5
33+
# env:
34+
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

‎sonar-project.properties

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# must be unique in a given SonarQube instance
2+
sonar.projectKey=chef_fauxhai_AYcpqaYGJ4YHsO5MtJYJ
3+
4+
# defaults to project key
5+
sonar.projectName=fauxhai
6+
# defaults to 'not provided'
7+
#sonar.projectVersion=1.0
8+
9+
sonar.sources=.
10+
sonar.exclusions=**/*_test.go
11+
12+
sonar.tests=.
13+
sonar.test.inclusions=**/*_test.go
14+
15+
# Encoding of the source code. Default is default system encoding
16+
#sonar.sourceEncoding=UTF-8
17+
18+
# skip C-language processor
19+
sonar.c.file.suffixes=-
20+
sonar.cpp.file.suffixes=-
21+
sonar.objc.file.suffixes=-

0 commit comments

Comments
 (0)
Please sign in to comment.