From 632d731584cbd79ddae96754cf4f6cabb93ba3fd Mon Sep 17 00:00:00 2001 From: Ivan Gonzalez <135244609+ivgonzalezc@users.noreply.github.com> Date: Wed, 27 Dec 2023 11:07:55 -0500 Subject: [PATCH] Refactor: Sonarqube workflow refactor (#52) --- .github/workflows/sonarqube.yml | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 283abda..d566ee1 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -11,7 +11,7 @@ permissions: contents: write jobs: - unit_test: + sonarqube: runs-on: ubuntu-latest steps: - name: Checkout code @@ -25,27 +25,6 @@ jobs: go test -race -coverprofile=coverage.out -v ls -alt go tool cover -func="coverage.out" - - - name: Save unit tests coverage - uses: actions/upload-artifact@v4 - with: - name: coverage - path: api/client/coverage.out - - sonarqube: - # Sonar scan is not required for dependabot PRs - runs-on: ubuntu-latest - needs: unit_test - steps: - - name: Checkout code - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 0 - - - name: Download coverage - uses: actions/download-artifact@v4 - with: - name: coverage - name: SonarQube Scan on PR if: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' }} @@ -58,7 +37,7 @@ jobs: -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.pullrequest.base=${{ github.base_ref }} -Dsonar.exclusions=provider/**,main.go,api/client/client_test.go - -Dsonar.go.coverage.reportPaths=coverage.out + -Dsonar.go.coverage.reportPaths=api/client/coverage.out env: SONAR_TOKEN: ${{ env.SONAR_TOKEN }} SONAR_HOST_URL: https://sonar.dev.beyondtrust.com