Skip to content

Commit

Permalink
Migrate to SonarCloud (#2027)
Browse files Browse the repository at this point in the history
* Migrate to SonarCloud
  • Loading branch information
vcastellm committed Nov 3, 2023
1 parent fa8c777 commit 4dc5d91
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,19 @@ jobs:
id: run_tests_failure
run: echo "test_output=false" >> $GITHUB_OUTPUT

# Triggering SonarQube analysis as results of it are required by Quality Gate check.
- name: SonarQube Scan
if: ${{ env.HAVE_SONAR_TOKEN == 'true' }}
uses: sonarsource/sonarqube-scan-action@master
env:
HAVE_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN != '' }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

# Check the Quality Gate status.
- name: SonarQube Quality Gate check
id: sonarqube-quality-gate-check
sonar-scan:
name: SonarQube Scan
needs: go_test
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
if: ${{ env.HAVE_SONAR_TOKEN == 'true' }}
uses: sonarsource/sonarqube-quality-gate-action@master
# Force to fail step after specific time.
timeout-minutes: 5
uses: SonarSource/sonarcloud-github-action@master
env:
HAVE_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN != '' }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
3 changes: 2 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sonar.projectKey=polygon-edge
sonar.projectKey=0xPolygon_polygon-edge
sonar.organization=0xpolygon

sonar.sources=.
sonar.exclusions=**/*_test.go,**/vendor/**,**/*.py,**/core-contracts/**,**/tests/**
Expand Down

0 comments on commit 4dc5d91

Please sign in to comment.