-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
144 lines (129 loc) · 3.14 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
properties([
buildDiscarder(logRotator(artifactNumToKeepStr: '10')),
disableConcurrentBuilds() //disableds parallel builds
])
node('spoofax-buildenv-jenkins') {
// In Jenkins, under Tools, add a JDK Installation with:
// - Name: JDK 11
// - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64
// - Install automatically: false
// Ensure the JDK 11 is available in the Spoofax Docker image at the specified path.
jdk = tool name: 'JDK 11'
env.JAVA_HOME = "${jdk}"
try{
stage('Echo') {
// Print important variables and versions for debugging purposes.
sh 'env'
sh 'bash --version'
sh 'git --version'
sh 'python3 --version'
sh 'pip3 --version'
sh "$JAVA_HOME/bin/java -version"
sh "$JAVA_HOME/bin/javac -version"
sh 'mvn --version'
}
stage('Checkout') {
checkout scm
sh '''
git clean -fXd
git clone https://github.com/metaborg/spt.git
git clone https://github.com/metaborg/spoofax-sunshine.git
'''
}
stage('Build SPT Runner') {
withMaven(
mavenLocalRepo: ".repository",
mavenOpts: '-Xmx4G -Xms4G -Xss64m'
) {
sh '''
cd spt/org.metaborg.spt.cmd
mvn package
ls target/org.metaborg.spt.cmd*
cd ../../
'''
}
}
stage('Build SPT Language') {
withMaven(
mavenLocalRepo: ".repository",
mavenOpts: '-Xmx4G -Xms4G -Xss64m'
) {
sh '''
cd spt/org.metaborg.meta.lang.spt
mvn clean verify
cd ../../
'''
}
}
stage('Build Spoofax Sunshine') {
withMaven(
mavenLocalRepo: ".repository",
mavenOpts: '-Xmx4G -Xms4G -Xss64m'
) {
sh '''
cd spoofax-sunshine/org.metaborg.sunshine2
mvn package
ls target/org.metaborg.sunshine2*
cd ../../
'''
}
}
stage('Build WebDSL-Statix') {
withMaven(
mavenLocalRepo: ".repository",
mavenOpts: '-Xmx4G -Xms4G -Xss64m'
) {
sh '''
cd webdslstatix
mvn clean verify
cd ../
'''
}
}
stage('Run SPT Tests (Syntax)') {
withMaven(
mavenLocalRepo: ".repository",
mavenOpts: '-Xmx4G -Xms4G -Xss64m'
) {
sh '''
./run_spt_tests
'''
}
}
stage('Run Analysis Tests') {
withMaven(
mavenLocalRepo: ".repository",
mavenOpts: '-Xmx4G -Xms4G -Xss64m'
) {
sh '''
./run_analysis_tests
'''
}
}
stage('Run End-To-End Tests') {
withMaven(
mavenLocalRepo: ".repository",
mavenOpts: '-Xmx4G -Xms4G -Xss64m'
) {
sh '''
./run_end_to_end_tests
'''
}
}
stage('Archive') {
archiveArtifacts(
artifacts: 'spt-results/ , e2e-results/, analysis-results/',
excludes: null,
onlyIfSuccessful: false
)
}
stage('Cleanup') {
sh '''
rm -rf spt
git clean -fXd
'''
}
} catch (e) {
throw e
}
}