Skip to content

Commit

Permalink
Add coverage module & file lint test (apache#10920)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ authored Nov 12, 2022
1 parent b684944 commit 7705811
Show file tree
Hide file tree
Showing 15 changed files with 1,315 additions and 126 deletions.
8 changes: 5 additions & 3 deletions Jenkinsfile.sonar
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
*
*/
pipeline {
agent any
agent {
label 'ubuntu'
}

tools {
maven 'maven_3_latest'
Expand All @@ -34,12 +36,12 @@ pipeline {
if ( env.BRANCH_NAME.startsWith("PR-") ) {
// this is a pull request
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONAR_TOKEN')]) {
sh 'mvn --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean verify sonar:sonar -Pjacoco -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -Dsonar.pullrequest.branch=${CHANGE_BRANCH} -Dsonar.pullrequest.base=${CHANGE_TARGET} -Dsonar.pullrequest.key=${CHANGE_ID} -Dsonar.login=${SONAR_TOKEN}'
sh 'mvn --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean verify sonar:sonar -Pjacoco -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -Dsonar.coverage.jacoco.xmlReportPaths=dubbo-test/dubbo-dependencies-all/target/site/jacoco-aggregate/jacoco.xml -Dsonar.pullrequest.branch=${CHANGE_BRANCH} -Dsonar.pullrequest.base=${CHANGE_TARGET} -Dsonar.pullrequest.key=${CHANGE_ID} -Dsonar.login=${SONAR_TOKEN}'
}
} else {
// this is just a branch
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONAR_TOKEN')]) {
sh 'mvn --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean verify sonar:sonar -Pjacoco -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.login=${SONAR_TOKEN}'
sh 'mvn --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean verify sonar:sonar -Pjacoco -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -Dsonar.coverage.jacoco.xmlReportPaths=dubbo-test/dubbo-dependencies-all/target/site/jacoco-aggregate/jacoco.xml -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.login=${SONAR_TOKEN}'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<maven.compiler.target>8</maven.compiler.target>
<slf4j-log4j12.version>1.7.25</slf4j-log4j12.version>
<spring-boot.version>2.3.1.RELEASE</spring-boot.version>
<skip_maven_deploy>true</skip_maven_deploy>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<maven.compiler.target>8</maven.compiler.target>
<slf4j-log4j12.version>1.7.25</slf4j-log4j12.version>
<spring-boot.version>2.3.1.RELEASE</spring-boot.version>
<skip_maven_deploy>true</skip_maven_deploy>
</properties>

<dependencies>
Expand Down
Loading

0 comments on commit 7705811

Please sign in to comment.