Skip to content

Commit

Permalink
Added in sonar scan to the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorHalf committed Feb 7, 2024
1 parent a6fcac3 commit 5dae1bd
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: PR-checks

on:
push:
branches: ['develop']
branches: ['develop','feature/CB2-10757']
pull_request:
branches: ['develop']
branches: ['develop','feature/CB2-10757']

jobs:
build-test:
Expand Down Expand Up @@ -37,4 +37,34 @@ jobs:
run: npm run build

- name: Integration tests
run: npm run test-i
run: npm run test-i

scanner:
permissions:
id-token: write
runs-on: X64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CVS_MGMT_AWS_ROLE }}
aws-region: ${{ secrets.DVSA_AWS_REGION }}
role-session-name: 'cvs-app-vtm'
- uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
secret-ids: sonarqube-gha
parse-json-secrets: true
- name: Install dependencies
run: npm ci
- name: Run SonarQube scanner
run: |
npm run test:unit:coverage && \
npm run sonar-scanner -- \
-Dsonar.host.url=${{ env.SONARQUBE_GHA_URL }} \
-Dsonar.token=${{ env.SONARQUBE_GHA_TOKEN }} \
-Dsonar.login=${{ env.SONARQUBE_GHA_TOKEN }} \
-Dsonar.projectName=${{ github.repository }} \
-Dsonar.projectVersion=1.0.${{ github.run_id }}
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"serverless-offline": "12.0.4",
"serverless-s3-local": "0.7.2",
"serverless-webpack": "5.13.0",
"sonar-scanner": "3.1.0",
"supertest": "6.3.3",
"ts-jest": "29.1.1",
"ts-loader": "9.4.4",
Expand Down

0 comments on commit 5dae1bd

Please sign in to comment.