diff --git a/.devops/code-review-pipelines.yml b/.devops/code-review-pipelines.yml index dd603f1a..9c534411 100644 --- a/.devops/code-review-pipelines.yml +++ b/.devops/code-review-pipelines.yml @@ -1 +1,53 @@ -trigger: none # Disable CI triggers. \ No newline at end of file +pr: + - develop + - uat + - main + +pool: + vmImage: ubuntu-22.04 + +steps: + - checkout: self + displayName: Checkout + fetchDepth: 1 + + - task: SonarCloudPrepare@1 + displayName: 'Prepare SonarCloud analysis configuration' + inputs: + SonarCloud: '$(SONARCLOUD_SERVICE_CONN)' + organization: '$(SONARCLOUD_ORG)' + scannerMode: Other + extraProperties: | + sonar.projectKey=$(SONARCLOUD_PROJECT_KEY) + sonar.projectName=$(SONARCLOUD_PROJECT_NAME) + sonar.exclusions='**/enums/**, **/model/**, **/dto/**, **/*Constant*, **/*Config.java, **/*Scheduler.java, **/*Application.java, **/src/test/**, **/Dummy*.java' + + - task: Gradle@3 + inputs: + workingDirectory: './' + gradleWrapperFile: './gradlew' + tasks: 'clean build jacocoTestReport' + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.17' + sonarQubeRunAnalysis: false + + - bash: xmlReportPaths=$(find "$(pwd)" -path '*jacoco.xml' | sed 's/.*/&/' | tr '\n' ','); echo "##vso[task.setvariable variable=xmlReportPaths]$xmlReportPaths" + displayName: finding jacoco.xml + + - task: Gradle@3 + inputs: + workingDirectory: './' + gradleWrapperFile: './gradlew' + tasks: "sonar" + options: '-Dsonar.coverage.jacoco.xmlReportPaths=$(xmlReportPaths) -Dorg.gradle.jvmargs=-Xmx4096M' + publishJUnitResults: false + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.17' + sonarQubeRunAnalysis: false + sqGradlePluginVersionChoice: 'build' + + - task: SonarCloudPublish@1 + inputs: + pollingTimeoutSec: '300' \ No newline at end of file diff --git a/gradlew b/gradlew old mode 100644 new mode 100755