Skip to content

Commit f60cbab

Browse files
authored
Merge pull request #128 from NHSDigital/timireland/sonarcloud-coverage
Add jest coverage report sonarcloud analysis
2 parents 3910663 + 526f4c0 commit f60cbab

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.github/workflows/stage-2-test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ jobs:
6363
name: unit-tests
6464
path: ".reports/unit"
6565
if: always()
66+
- name: "Save the result of code coverage"
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: code-coverage-report
70+
path: ".reports/unit/coverage/lcov.info"
71+
if: always()
6672
test-lint:
6773
name: "Linting"
6874
runs-on: ubuntu-latest
@@ -124,6 +130,10 @@ jobs:
124130
uses: actions/checkout@v4
125131
with:
126132
fetch-depth: 0 # Full history is needed to improving relevancy of reporting
133+
- name: "Download coverage report for SONAR"
134+
uses: actions/download-artifact@v4
135+
with:
136+
name: code-coverage-report
127137
- name: "Perform static analysis"
128138
uses: ./.github/actions/perform-static-analysis
129139
with:

.gitleaksignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:generic-api-key:37
44
87312c6a627a7b0420956d49187fd15b130df170:src/__tests__/components/molecules/LoginStatus.test.tsx:jwt:23
5+
37ca9f5670f4cd7d91869845ca27defbe6156bb9:src/__tests__/components/molecules/LoginStatus.test.tsx:jwt:23

scripts/config/sonar-scanner.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ sonar.terraform.provider.aws.version=5.54.1
88
sonar.cpd.exclusions=**.test.*
99

1010
#sonar.python.coverage.reportPaths=.coverage/coverage.xml
11-
#sonar.[javascript|typescript].lcov.reportPaths=.coverage/lcov.info
11+
sonar.javascript.lcov.reportPaths=lcov.info

0 commit comments

Comments
 (0)