Skip to content

Commit

Permalink
Merge pull request #909 from nhsuk/sonarcloud
Browse files Browse the repository at this point in the history
Add sonarcloud to pull request pipeline
  • Loading branch information
roshaanbajwa authored Dec 7, 2023
2 parents 5692eed + 94c8dee commit 3302f09
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ jobs:

- name: Install dependencies
run: npm install


- name: Sonar analysis
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: .
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

- name: Run linting
run: npm run lint

Expand Down
24 changes: 24 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SonarQube properties
sonar.projectKey=nhsuk-frontend
sonar.organization=nhsdigital

# Project language
sonar.language=js

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

# Add file exclusions
sonar.exclusions=reports/**

# Add coverage exclusions
sonar.coverage.exclusions=**/*.config.js,**/coverage/**,**/*check-report.html

# Adding the dependency-check parameter
sonar.dependencyCheck.htmlReportPath=reports/dependency-check/dependency-check-report.html

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

# Adding the coverage analysis parameter
sonar.javascript.lcov.reportPaths=./coverage/lcov.info

0 comments on commit 3302f09

Please sign in to comment.