From ea48ec0ac476609cd4bd272b08f56444e03e4efc Mon Sep 17 00:00:00 2001 From: Victor Toupitzen Specian Date: Mon, 20 May 2024 19:09:33 -0300 Subject: [PATCH] Update pipeline.yml --- .github/workflows/pipeline.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 4a11095..5a04a25 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -11,7 +11,11 @@ jobs: - name: Check out code uses: actions/checkout@v3 - name: Unit Tests - run: go clean -testcache && go test -v ./... + run: go clean -testcache && go test -v ./... -v -coverprofile=coverage.out + - uses: actions/upload-artifact@v4 + with: + name: coverage.out + path: coverage.out code-analisys: needs: unit-test @@ -20,6 +24,10 @@ jobs: steps: - name: Clone Repository uses: actions/checkout@v3 + - name: Download coverage reports + uses: actions/download-artifact@v4 + with: + name: coverage.out - name: Analyze with SonarCloud uses: sonarsource/sonarcloud-github-action@master with: @@ -27,6 +35,8 @@ jobs: args: > -Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }} -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }} + -Dsonar.go.coverage.reportPaths=../../../coverage.out + -Dsonar.exclusions=**/*_test.go env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}