Merge pull request #3 from fernandatoledo/sonar #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SonarQube analysis | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
push: | |
branches: | |
- main | |
- master | |
- staging | |
- qa | |
- development | |
env: | |
SONAR_PROJECT: myapp-delete | |
jobs: | |
sonar: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📦 Checkout project repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: 📦 Setup Node + PNPM + install deps | |
uses: ./.github/actions/setup-node-pnpm-install | |
- name: Run Tests | |
run: export NODE_OPTIONS=--experimental-vm-modules && pnpm test:ci | |
- name: SonarQube Scan | |
uses: sonarsource/sonarqube-scan-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_URL }} | |
with: | |
args: > | |
-Dsonar.sonar.sources=./src | |
-Dsonar.qualitygate.wait=true | |
-Dsonar.projectBaseDir=. | |
-Dsonar.verbose=false | |
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT }} | |
-Dsonar.sonar.sourceEncoding=UTF-8 | |
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info | |
-Dsonar.coverage.exclusions=**/storage/**,**/**.config.js,**/*.test.tsx,**/icons/** |