Skip to content

Sonar

Sonar #7

Workflow file for this run

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 && yarn test --coverage
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_URL }}
with:
args: >
-Dsonar.qualitygate.wait=true
-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.sonar.sourceEncoding=UTF-8
-Dsonar.sonar.sources=.
-Dsonar.projectBaseDir=.
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.coverage.exclusions=**/scripts/**,**/network/**,**/storage/**,**/**.config.js,**/rnb-cli/**,**/rnbv.js,**/android/**,**/**.styles.ts,**/tests/**,**/provider/**,**/__mocks__/**,**/__tests__/**,**/httpClient/**,**/queryClient/index.ts,**/hooks/*,**/jest-setup.js,**/azureClient/**,**/context/Theme/**,**/constants/**,**/hooks/useRootNavigation.ts,**/assets/**,**/locale/**,**/test.tsx,**/*.test.tsx