Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions .github/workflows/build.yml

This file was deleted.

50 changes: 41 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ pipeline {
jdk 'jdk8'
}
steps {
sh '''
echo "PATH = ${PATH}"
echo "JAVA_HOME = ${JAVA_HOME}"
echo "M2_HOME = ${M2_HOME}"
mvn --version
'''
sh 'env|sort'
}
}
stage ('Build') {
Expand All @@ -42,7 +37,7 @@ pipeline {
}
}
steps {
sh 'mvn -Dunit-test-wlst-dir=${WLST_DIR} test'
sh 'mvn -B -Dunit-test-wlst-dir=${WLST_DIR} test'
}
post {
always {
Expand All @@ -67,15 +62,34 @@ pipeline {
}
}
steps {
sh 'mvn -DskipITs=false -Dmw_home=${ORACLE_HOME} -Ddb.use.container.network=true verify'
sh 'mvn -B -DskipITs=false -Dmw_home=${ORACLE_HOME} -Ddb.use.container.network=true verify'
}
post {
always {
junit 'system-test/target/failsafe-reports/*.xml'
}
}
}
stage ('Alias Test') {
stage ('Analyze') {
when {
anyOf {
changeRequest()
branch "main"
}
}
tools {
maven 'maven-3.6.0'
jdk 'jdk11'
}
steps {
withSonarQubeEnv('SonarCloud') {
withCredentials([string(credentialsId: 'encj_github_token', variable: 'GITHUB_TOKEN')]) {
runSonarScanner()
}
}
}
}
stage ('Alias Test') {
// only run this stage when triggered by a cron timer and the commit does not have []skip-ci in the message
// for example, only run integration tests during the timer triggered nightly build
when {
Expand Down Expand Up @@ -129,6 +143,24 @@ pipeline {
'''
}
}
}
}

void runSonarScanner() {
def changeUrl = env.CHANGE_URL.split("/")
def org = changeUrl[3]
def repo = changeUrl[4]
if (changeRequest()) {
sh "mvn -B sonar:sonar \
-Dsonar.projectKey=${org}_${repo} \
-Dsonar.pullrequest.provider=GitHub \
-Dsonar.pullrequest.github.repository=${org}/${repo} \
-Dsonar.pullrequest.key=${env.CHANGE_ID} \
-Dsonar.pullrequest.branch=${env.CHANGE_BRANCH} \
-Dsonar.pullrequest.base=${env.CHANGE_TARGET}"
} else {
sh "mvn -B sonar:sonar \
-Dsonar.projectKey=${org}_${repo} \
-Dsonar.branch.name=${env.BRANCH_NAME}"
}
}
8 changes: 4 additions & 4 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -163,10 +167,6 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
23 changes: 7 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.sources>src/main</sonar.sources>
<sonar.java.source>7</sonar.java.source>
<sonar.python.version>2</sonar.python.version>
<sonar.exclusions>.flattened-pom.xml,target/**</sonar.exclusions>
<sonar.test.exclusions>src/test/**</sonar.test.exclusions>
<sonar.test.exclusions>core/src/test/**</sonar.test.exclusions>
<sonar.coverage.jacoco.xmlReportPaths>core/target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>

<unit-test-wlst-dir>${env.WLST_DIR}</unit-test-wlst-dir>
<skipITs>true</skipITs>
<alias-test-skipITs>true</alias-test-skipITs>
Expand Down Expand Up @@ -152,10 +155,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<!-- Created by jacoco plugin (inherited configuration) -->
<argLine>${surefireArgLine}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>io.rhpatrick.mojo</groupId>
Expand Down Expand Up @@ -183,25 +182,17 @@
<version>0.8.7</version>
<executions>
<execution>
<id>pre-unit-test</id>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>site</phase>
<id>report</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
<dataFile>${sonar.jacoco.reportPath}</dataFile>
</configuration>
</execution>
</executions>
</plugin>
Expand Down