Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#20): Add SonarQube #22

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Code Quality Test

# Run for any commits to any branch
on: [push, pull_request, workflow_dispatch]

env:
SONAR_PROJECT: ${{ secrets.SONAR_PROJECT }}
SONAR_URL: ${{ secrets.SONAR_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Setup sonar scanner
uses: warchant/setup-sonar-scanner@v3
- name: Run Sonarqube analysis
run: |
sonar-scanner \
-Dsonar.qualitygate.wait=true \
-Dsonar.host.url=$SONAR_URL \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.projectKey=$SONAR_PROJECT \
-Dsonar.scm.provider=git \
-Dsonar.java.binaries=/tmp \
-Dsonar.nodejs.executable=$(which node) \
-Dsonar.projectVersion=$(echo $GITHUB_SHA | cut -c1-8) \
-Dsonar.sources=. \
-Dsonar.projectBaseDir=. \
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info