Skip to content

Commit

Permalink
DCMAW-10726: Add Sonar steps to pre-merge workflow for test-resources…
Browse files Browse the repository at this point in the history
… directory (#282)
  • Loading branch information
jhumbert-dd authored Dec 3, 2024
1 parent d10b489 commit 63a7f97
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test-resources-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,20 @@ jobs:

- name: Validate SAM template
run: sam validate --lint

- name: Run SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@383f7e52eae3ab0510c3cb0e7d9d150bbaeab838 # master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectBaseDir: test-resources

- name: Run SonarQube Quality Gate check
uses: Sonarsource/sonarqube-quality-gate-action@8406f4f1edaffef38e9fb9c53eb292fc1d7684fa # master
# Force to fail step after specific time
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
scanMetadataReportFile: test-resources/.scannerwork/report-task.txt
2 changes: 1 addition & 1 deletion test-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"deploy": "cd ../helper-scripts && ./deploy_test_resources.sh",
"format": "./node_modules/.bin/prettier --write '**/*.ts'",
"format:check": "./node_modules/.bin/prettier --check '**/*.ts'",
"lint": "./node_modules/.bin/eslint ./dequeue",
"lint": "./node_modules/.bin/eslint ./src/dequeue",
"test:unit": "./node_modules/.bin/jest --testPathPattern=dequeue/ --silent"
},
"engines": {
Expand Down
8 changes: 8 additions & 0 deletions test-resources/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sonar.projectKey=mobile-id-check-async-test-resources
sonar.organization=govuk-one-login

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=src
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.language=ts
sonar.exclusions=**/*.test.ts
File renamed without changes.
2 changes: 1 addition & 1 deletion test-resources/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Resources:
Target: es2022
Sourcemap: false
EntryPoints:
- dequeue/dequeueHandler.ts
- src/dequeue/dequeueHandler.ts
Properties:
FunctionName: !Sub ${AWS::StackName}-dequeue
Runtime: nodejs20.x
Expand Down

0 comments on commit 63a7f97

Please sign in to comment.