Skip to content

Commit

Permalink
Refactor: Sonarqube workflow refactor (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivgonzalezc authored Dec 27, 2023
1 parent 095d34a commit 632d731
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
contents: write

jobs:
unit_test:
sonarqube:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -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' }}
Expand All @@ -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
Expand Down

0 comments on commit 632d731

Please sign in to comment.