Skip to content

Commit

Permalink
chore: run sonar experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
apurv-wednesday committed Apr 9, 2024
1 parent 898bc44 commit bbe630e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/sonar-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: SonarQube Analysis
on:
push:
branches:
- "feat/add-sonar"
jobs:
sonarqube-analysis:
name: SonarQube Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ yarn-error.log*
/public/sw.js.map
/public/workbox-*.js.map
/public/worker-*.js.map
/public/fallback-*.js
/public/fallback-*.js
reports
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "next lint",
"lint:staged": "lint-staged",
"prepare": "husky install",
"test": "cross-env NODE_ENV=test jest",
"test": "cross-env NODE_ENV=test jest --coverage",
"test:watch": "jest --env=jsdom --watch",
"test:coverage": "jest --env=jsdom --coverage",
"prettify": "prettier --write ./**/*.ts",
Expand Down
26 changes: 20 additions & 6 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# Project identification
sonar.organization=wednesday-solutions
sonar.projectKey=wednesday-solutions_next-bulletproof-ts_AY6yu6eKB2n8RRmGoUz4

# Specify the language
sonar.language=ts

# Source directory
sonar.sources=.
sonar.tests=app
sonar.exclusions=**/tests/**/*.*,**/storybook/**/*.*,**/internals/**/*.*,**/server/**/*.*,app/**/*.test.{ts,tsx},app/*/RbGenerated*/*.{ts,tsx},app/app.ts,app/global-styles.ts,app/*/*/loadable.{ts,tsx},**/loadable.ts,**/apiUtils.ts,**/testUtils.ts,**/stories/**,**/themes/index.ts
sonar.test.inclusions=**/*.test.ts, **/*.test.tsx
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar.testExecutionReportPaths=./reports/test-report.xml
sonar.sourceEncoding=UTF-8

# Test directory
sonar.tests=common,containers,features,pages,store,styles,themes,translations,utils

# Exclude node_modules
# Let's not exclude anything for now, after refractoring changes we can decide what to exclude from the analysis
sonar.exclusions=node_modules/**/*

# Encoding of the source code
sonar.sourceEncoding=UTF-8

# Coverage report path
sonar.javascript.lcov.reportPaths=coverage/lcov.info

# Test execution report path
sonar.testExecutionReportPaths=./reports/test-report.xml

0 comments on commit bbe630e

Please sign in to comment.