Skip to content

Commit 16837a7

Browse files
authored
add sonar analysis (#23)
## Summary - Routine Change ### Details - enable sonar analysis
1 parent 11752c2 commit 16837a7

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

.github/workflows/quality_checks.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
quality_checks:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- uses: actions/setup-java@v3
14+
with:
15+
java-version: '21'
16+
distribution: 'adopt'
1317
- name: Checkout code
1418
uses: actions/checkout@v4
1519
with:
@@ -48,11 +52,12 @@ jobs:
4852
- name: run lint
4953
run: make lint
5054

51-
- name: run unit tests
52-
run: make test
53-
54-
# - name: SonarCloud Scan
55-
# uses: SonarSource/sonarcloud-github-action@master
56-
# env:
57-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
55+
- name: run tests and Sonar scan
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
58+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
59+
run: |
60+
# shellcheck source=/dev/null
61+
. ~/.asdf/plugins/java/set-java-home.bash
62+
make download-dependencies
63+
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=NHSDigital_eps-FHIR-validator-lambda

.github/workflows/sam_package_code.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
contents: read
1212
packages: read
1313
steps:
14+
- uses: actions/setup-java@v3
15+
with:
16+
java-version: '21'
17+
distribution: 'adopt'
1418
- name: Checkout code
1519
uses: actions/checkout@v4
1620
with:
@@ -57,4 +61,3 @@ jobs:
5761
name: packaged_code
5862
path: |
5963
.aws-sam/build
60-

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
maven 3.9.0
2-
java openjdk-21.0.2
2+
java adoptopenjdk-21.0.2+13.0.LTS
33
python 3.8.15
44
poetry 1.6.1
55
shellcheck 0.9.0
66
direnv 2.32.2
7-
actionlint 1.6.26
7+
actionlint 1.6.26

SAMtemplates/main_template.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,3 @@ Outputs:
8484
Value: !GetAtt FHIRValidator.Arn
8585
Export:
8686
Name: !Join [":", [!Ref "AWS::StackName", "FHIRValidatorLambdaArn"]]
87-

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<fhir.version>5.5.0</fhir.version>
1717
<log4j.version>2.23.0</log4j.version>
1818
<fasterxml.version>2.16.1</fasterxml.version>
19+
<sonar.organization>nhsdigital</sonar.organization>
20+
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
1921
</properties>
2022
<dependencyManagement>
2123
<dependencies>

0 commit comments

Comments
 (0)