Skip to content

Commit

Permalink
Merge pull request #123 from nhsconnect/config-sonarcloud-coverage
Browse files Browse the repository at this point in the history
setup sonarcloud config & github action for coverage
  • Loading branch information
chrisbloe-nhse authored Jun 12, 2024
2 parents c82f887 + cb29d78 commit 04c1e4c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Run test coverage
run: |
./tasks test_coverage_github_action
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"test:docker": "npm run test:health",
"test:functional": "jest test/functional/*",
"test:e2e": "jest test/e2e/*",
"test:coverage": "jest src/ --maxWorkers=1 --coverage --detectOpenHandles --forceExit --setupFiles dotenv/config"
"test:coverage": "jest src/ --maxWorkers=1 --coverage --detectOpenHandles --forceExit --setupFiles dotenv/config",
"test:coverage-unit-test-only": "jest \"src/(?!(.*\\integration.test\\.js))\" --maxWorkers=1 --coverage --detectOpenHandles --forceExit --setupFiles dotenv/config"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.529.1",
Expand Down
4 changes: 4 additions & 0 deletions tasks
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ case "${command}" in
die_repo_in_perf_die
dojo -c Dojofile-itest "./tasks _test_coverage"
;;
test_coverage_github_action)
npm install
npm run test:coverage-unit-test-only
;;
_build)
rm -rf build
npm install
Expand Down

0 comments on commit 04c1e4c

Please sign in to comment.