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

Add sonarcloud to pull request pipeline #909

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading