Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SonarCloud #31

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
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

Expand All @@ -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
Expand Down
15 changes: 15 additions & 0 deletions sonar-project.properties
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