-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from virtru/feature/sonar
SonarCloud
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Quality Gate | ||
name: Quality Gate and SonarCloud analysis | ||
env: | ||
COVERAGE_THRESH_PCT: 81 | ||
|
||
|
@@ -22,6 +22,11 @@ jobs: | |
run: go install github.com/klmitch/[email protected] | ||
- name: Run unit test with coverage | ||
run: go test --coverprofile cover.out ./pdp ./attributes ./protoconv | ||
- name: SonarCloud scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
- name: Check coverage meets threshold | ||
run: overcover --coverprofile cover.out ./pdp ./attributes --threshold ${{ env.COVERAGE_THRESH_PCT }} | ||
- uses: actions/setup-python@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# must be unique in a given SonarQube instance | ||
sonar.projectKey=virtru_access-pdp | ||
sonar.organization=virtru | ||
|
||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. | ||
# This property is optional if sonar.modules is set. | ||
sonar.sources=attributes,pdp,protoconv | ||
sonar.exclusions=**/*_test.go,**/mock_*.go | ||
|
||
sonar.test.inclusions=**/*_test.go | ||
|
||
sonar.go.coverage.reportPaths=cover.out | ||
|
||
# Encoding of the source code. Default is default system encoding | ||
sonar.sourceEncoding=UTF-8 |