forked from eclipse-jdt/eclipse.jdt.core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
91 lines (83 loc) · 4.16 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pipeline {
options {
timeout(time: 90, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'15'))
disableConcurrentBuilds(abortPrevious: true)
timestamps()
}
agent {
label "ubuntu-latest"
}
tools {
maven 'apache-maven-latest'
jdk 'openjdk-jdk23-latest'
}
stages {
stage('Build and Test') {
steps {
sh """#!/bin/bash -x
java -version
mkdir -p $WORKSPACE/tmp
unset JAVA_TOOL_OPTIONS
unset _JAVA_OPTIONS
# The max heap should be specified for tycho explicitly
# via configuration/argLine property in pom.xml
# export MAVEN_OPTS="-Xmx2G"
mvn clean install -f org.eclipse.jdt.core.compiler.batch -DlocalEcjVersion=99.99 -Dmaven.repo.local=$WORKSPACE/.m2/repository -DcompilerBaselineMode=disable -DcompilerBaselineReplace=none
# Build and test without DOM-first to ensure no regression takes place
mvn -U clean verify --batch-mode --fail-at-end -Dmaven.repo.local=$WORKSPACE/.m2/repository \
-pl !org.eclipse.jdt.core.tests.javac \
-Ptest-on-javase-23 -Pbree-libs -Papi-check -Pjavadoc -Pp2-repo \
-Dmaven.test.failure.ignore=true \
-Dcompare-version-with-baselines.skip=false \
-Djava.io.tmpdir=$WORKSPACE/tmp -Dproject.build.sourceEncoding=UTF-8 \
-Dtycho.surefire.argLine="--add-modules ALL-SYSTEM -Dcompliance=1.8,11,17,21,23 -Djdt.performance.asserts=disabled" \
-DDetectVMInstallationsJob.disabled=true \
-Dtycho.apitools.debug \
-Dtycho.debug.artifactcomparator \
-Dcbi-ecj-version=99.99
"""
}
post {
always {
// The following lines use the newest build on master that did not fail a reference
// To not fail master build on failed test maven needs to be started with "-Dmaven.test.failure.ignore=true" it will then only marked unstable.
// To not fail the build also "unstable: true" is used to only mark the build unstable instead of failing when qualityGates are missed
// Also do not record mavenConsole() as failing tests are logged with ERROR duplicating the failure into the "Maven" plugin
// To accept unstable builds (test errors or new warnings introduced by third party changes) as reference using "ignoreQualityGate:true"
// To only show warnings related to the PR on a PR using "publishAllIssues:false"
// The eclipse compiler name is changed because the logfile not only contains ECJ but also API warnings.
// "pattern:" is used to collect warnings in dedicated files avoiding output of junit tests treated as warnings
junit '**/target/surefire-reports/*.xml'
//discoverGitReferenceBuild referenceJob: 'eclipse.jdt.core-github/master'
//recordIssues publishAllIssues:false, ignoreQualityGate:true, tool: eclipse(name: 'Compiler and API Tools', pattern: '**/target/compilelogs/*.xml'), qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
}
}
}
stage('javac specific tests') {
steps {
sh """#!/bin/bash -x
mkdir -p $WORKSPACE/tmp
unset JAVA_TOOL_OPTIONS
unset _JAVA_OPTIONS
# force qualifier to start with `z` so we identify it more easily and it always seem more recent than upstrea
mvn install -DskipTests -Djava.io.tmpdir=$WORKSPACE/tmp \
-Dtycho.buildqualifier.format="'z'yyyyMMdd-HHmm" \
-Pp2-repo \
-pl org.eclipse.jdt.core.compiler.batch,org.eclipse.jdt.core,org.eclipse.jdt.core.javac,org.eclipse.jdt.core.tests.model,org.eclipse.jdt.core.tests.compiler,repository
mvn verify --batch-mode -f org.eclipse.jdt.core.tests.javac \
--fail-at-end -Ptest-on-javase-23 -Pbree-libs \
-DfailIfNoTests=false -DexcludedGroups=org.junit.Ignore -DproviderHint=junit47 \
-Papi-check -Djava.io.tmpdir=$WORKSPACE/tmp -Dproject.build.sourceEncoding=UTF-8 \
-Dmaven.test.failure.ignore=true -Dmaven.test.error.ignore=true
"""
}
post {
always {
archiveArtifacts artifacts: '*.log,*/target/work/data/.metadata/*.log,*/tests/target/work/data/.metadata/*.log,apiAnalyzer-workspace/.metadata/*.log,repository/target/repository/**,**/target/artifactcomparison/**', allowEmptyArchive: true
junit 'org.eclipse.jdt.core.tests.javac/target/surefire-reports/*.xml'
}
}
}
}
}