From b17437ebcbe36e2352169b0095eea5f1a9b5ba96 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Mon, 25 Nov 2024 12:13:13 -0800 Subject: [PATCH 1/3] Set up sonar for core and spring --- .github/workflows/.tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/.tests.yml b/.github/workflows/.tests.yml index d8bef0c..bdb0d9a 100644 --- a/.github/workflows/.tests.yml +++ b/.github/workflows/.tests.yml @@ -46,11 +46,11 @@ jobs: java-version: "17" sonar_args: > -Dsonar.organization=bcgov-sonarcloud - -Dsonar.projectKey=bcgov_nr-forest-client-commons + -Dsonar.projectKey=bcgov_nr-forest-client-commons-core -Dsonar.coverage.jacoco.xmlReportPaths=target/coverage-reports/merged-test-report/jacoco.xml -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml -Dsonar.coverage.exclusions= **/dto/**,**/*$*Builder* - sonar_token: ${{ secrets.SONAR_TOKEN_COMMONS }} + sonar_token: ${{ secrets.SONAR_CORE }} triggers: ('core/') - uses: bcgov-nr/action-test-and-analyse-java@v1.0.2 @@ -64,11 +64,11 @@ jobs: java-version: "17" sonar_args: > -Dsonar.organization=bcgov-sonarcloud - -Dsonar.projectKey=bcgov_nr-forest-client-commons + -Dsonar.projectKey=bcgov_nr-forest-client-commons-spring -Dsonar.coverage.jacoco.xmlReportPaths=target/coverage-reports/merged-test-report/jacoco.xml -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml -Dsonar.coverage.exclusions=**/configuration/**,**/exception/**,**/dto/**,**/entity/**,**/models/**,**/repository/**,**/*$*Builder*,**/ApplicationConstant* - sonar_token: ${{ secrets.SONAR_TOKEN_COMMONS }} + sonar_token: ${{ secrets.SONAR_SPRING }} triggers: ('spring/') - name: Archive CycloneDX From b31ca20b2b2476292d9b49f5296fc2f030a2980c Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Mon, 25 Nov 2024 12:13:27 -0800 Subject: [PATCH 2/3] Test --- .github/workflows/.tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/.tests.yml b/.github/workflows/.tests.yml index bdb0d9a..f3e620b 100644 --- a/.github/workflows/.tests.yml +++ b/.github/workflows/.tests.yml @@ -51,7 +51,7 @@ jobs: -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml -Dsonar.coverage.exclusions= **/dto/**,**/*$*Builder* sonar_token: ${{ secrets.SONAR_CORE }} - triggers: ('core/') + # triggers: ('core/') - uses: bcgov-nr/action-test-and-analyse-java@v1.0.2 name: Spring Coverage @@ -69,7 +69,7 @@ jobs: -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml -Dsonar.coverage.exclusions=**/configuration/**,**/exception/**,**/dto/**,**/entity/**,**/models/**,**/repository/**,**/*$*Builder*,**/ApplicationConstant* sonar_token: ${{ secrets.SONAR_SPRING }} - triggers: ('spring/') + # triggers: ('spring/') - name: Archive CycloneDX continue-on-error: true From 510594fe0a0b2bad90d3ade5d6e307dae4260fea Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Mon, 25 Nov 2024 15:27:28 -0800 Subject: [PATCH 3/3] Sonar project keys in 2x pom.xml --- .github/workflows/analysis.yml | 2 +- core/pom.xml | 2 +- spring/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index d9a947e..1ae1c5d 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -4,7 +4,7 @@ on: push: branches: [main] pull_request: - types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] + types: [opened, reopened, synchronize, ready_for_review] schedule: - cron: "0 11 * * 0" # 3 AM PST = 12 PM UDT, runs sundays workflow_dispatch: diff --git a/core/pom.xml b/core/pom.xml index 97553cd..f801c72 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -37,7 +37,7 @@ bcgov-sonarcloud https://sonarcloud.io - bcgov_nr-forest-client-commons + bcgov_nr-forest-client-commons-core target/coverage-reports/merged-test-report/jacoco.xml diff --git a/spring/pom.xml b/spring/pom.xml index de23604..2837720 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -46,7 +46,7 @@ bcgov-sonarcloud https://sonarcloud.io - bcgov_nr-forest-client-commons + bcgov_nr-forest-client-commons-spring target/coverage-reports/merged-test-report/jacoco.xml