Skip to content

Commit 96ef142

Browse files
committed
Add SonarCloud Scan
1 parent e6166e9 commit 96ef142

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.github/workflows/build.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,19 @@ jobs:
3232
version: latest
3333

3434
- name: Test
35-
run: go test ./...
35+
run:
36+
go test -covermode=atomic -coverpkg=./... -coverprofile=coverage.out
37+
-v ./...
3638

3739
- name: Build
3840
run: go build -o ./yamllint-action .
3941

42+
- name: SonarCloud Scan
43+
uses: SonarSource/[email protected]
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
47+
4048
push:
4149
name: Push
4250
needs: test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.idea
33
dist/
44
yamllint-action
5+
coverage.out

sonar-project.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
sonar.organization=staffbase
2+
sonar.projectKey=com.staffbase:yamllint-action
3+
sonar.projectDescription=Yamllint Action
4+
sonar.links.homepage=https://github.com/Staffbase/yamllint-action
5+
sonar.sourceEncoding=UTF-8
6+
7+
sonar.scm.provider=git
8+
9+
sonar.sources=.
10+
# Ignore:
11+
# - tests
12+
# - mocks
13+
# - commandline heavy initialization code (main and cmd)
14+
# - generated code (pkg/externaldns)
15+
sonar.exclusions=**/*_test.go
16+
17+
sonar.tests=.
18+
sonar.test.inclusions=**/*_test.go
19+
20+
sonar.go.coverage.reportPaths=coverage.out

0 commit comments

Comments
 (0)