Signed-off-by: Alex Meijer <ameijer@kubecost.com>
@@ -4,7 +4,9 @@ on:
pull_request:
branches:
- develop
-
+ push:
+ branches:
+ - develop
jobs:
backend:
runs-on: ubuntu-latest
@@ -41,6 +43,11 @@ jobs:
name: Build
run: |
just build-local
+ - name: Submit Code Coverage
+ uses: sonarsource/sonarqube-scan-action@master
+ env:
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
frontend:
@@ -8,7 +8,7 @@ default:
# Run unit tests
test:
- {{commonenv}} go test ./...
+ {{commonenv}} go test ./... -coverprofile=coverage.out
# Compile a local binary
build-local:
@@ -0,0 +1,3 @@
+sonar.projectKey=opencost
+sonar.sources=pkg,test
+sonar.go.coverage.reportPaths=coverage.out