1
1
pipeline {
2
- agent {
3
- dockerfile {
4
- additionalBuildArgs ' --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
5
- args ' -m 60g'
6
- }
7
- }
2
+ agent none
8
3
options {
9
4
ansiColor(' xterm' )
10
5
}
@@ -17,117 +12,213 @@ pipeline {
17
12
}
18
13
}
19
14
}
20
- stage(' Dependencies' ) {
21
- steps {
22
- sh '''
23
- make all-deps -B
24
- make split-tests -B
25
- '''
26
- }
27
- }
28
- stage(' Build' ) {
29
- steps {
30
- sh '''
31
- make build build-llvm build-haskell build-node -j4 -B
32
- '''
15
+ stage(' Build and Test' ) {
16
+ when { changeRequest() }
17
+ agent {
18
+ dockerfile {
19
+ additionalBuildArgs ' --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
20
+ args ' -m 60g'
21
+ }
33
22
}
34
- }
35
- stage(' Test Execution' ) {
36
- failFast true
37
- parallel {
38
- stage(' Conformance (OCaml)' ) {
23
+ stages {
24
+ stage(' Dependencies' ) {
39
25
steps {
40
26
sh '''
41
- nprocs=$(nproc)
42
- [ "$nprocs" -gt '16' ] && nprocs='16'
43
- make test-conformance -j"$nprocs" TEST_CONCRETE_BACKEND=ocaml
27
+ make all-deps -B
28
+ make split-tests -B
44
29
'''
45
30
}
46
31
}
47
- stage(' Conformance (LLVM) ' ) {
32
+ stage(' Build ' ) {
48
33
steps {
49
34
sh '''
50
- nprocs=$(nproc)
51
- [ "$nprocs" -gt '16' ] && nprocs='16'
52
- make test-conformance -j"$nprocs" TEST_CONCRETE_BACKEND=llvm
35
+ make build build-llvm build-haskell build-node -j4 -B
53
36
'''
54
37
}
55
38
}
56
- }
57
- }
58
- stage(' Test Proofs (Java)' ) {
59
- options {
60
- lock(" proofs-${ env.NODE_NAME} " )
61
- }
62
- steps {
63
- sh '''
64
- nprocs=$(nproc)
65
- [ "$nprocs" -gt '6' ] && nprocs='6'
66
- make test-proof -j"$nprocs"
67
- '''
68
- }
69
- }
70
- stage(' Test Interactive' ) {
71
- failFast true
72
- parallel {
73
- stage(' OCaml krun' ) {
74
- steps {
75
- sh '''
76
- make test-interactive-run TEST_CONCRETE_BACKEND=ocaml
77
- '''
39
+ stage(' Test Execution' ) {
40
+ failFast true
41
+ parallel {
42
+ stage(' Conformance (OCaml)' ) {
43
+ steps {
44
+ sh '''
45
+ nprocs=$(nproc)
46
+ [ "$nprocs" -gt '16' ] && nprocs='16'
47
+ make test-conformance -j"$nprocs" TEST_CONCRETE_BACKEND=ocaml
48
+ '''
49
+ }
50
+ }
51
+ stage(' Conformance (LLVM)' ) {
52
+ steps {
53
+ sh '''
54
+ nprocs=$(nproc)
55
+ [ "$nprocs" -gt '16' ] && nprocs='16'
56
+ make test-conformance -j"$nprocs" TEST_CONCRETE_BACKEND=llvm
57
+ '''
58
+ }
59
+ }
78
60
}
79
61
}
80
- stage(' LLVM krun' ) {
81
- steps {
82
- sh '''
83
- make test-interactive-run TEST_CONCRETE_BACKEND=llvm
84
- '''
62
+ stage(' Test Proofs (Java)' ) {
63
+ options {
64
+ lock(" proofs-${ env.NODE_NAME} " )
85
65
}
86
- }
87
- stage(' Java krun' ) {
88
66
steps {
89
67
sh '''
90
- make test-interactive-run TEST_CONCRETE_BACKEND=java
68
+ nprocs=$(nproc)
69
+ [ "$nprocs" -gt '6' ] && nprocs='6'
70
+ make test-proof -j"$nprocs"
91
71
'''
92
72
}
93
73
}
94
- stage(' Haskell krun' ) {
95
- steps {
96
- sh '''
97
- make test-interactive-run TEST_CONCRETE_BACKEND=haskell
98
- '''
74
+ stage(' Test Interactive' ) {
75
+ failFast true
76
+ parallel {
77
+ stage(' OCaml krun' ) {
78
+ steps {
79
+ sh '''
80
+ make test-interactive-run TEST_CONCRETE_BACKEND=ocaml
81
+ '''
82
+ }
83
+ }
84
+ stage(' LLVM krun' ) {
85
+ steps {
86
+ sh '''
87
+ make test-interactive-run TEST_CONCRETE_BACKEND=llvm
88
+ '''
89
+ }
90
+ }
91
+ stage(' Java krun' ) {
92
+ steps {
93
+ sh '''
94
+ make test-interactive-run TEST_CONCRETE_BACKEND=java
95
+ '''
96
+ }
97
+ }
98
+ stage(' Haskell krun' ) {
99
+ steps {
100
+ sh '''
101
+ make test-interactive-run TEST_CONCRETE_BACKEND=haskell
102
+ '''
103
+ }
104
+ }
105
+ stage(' OCaml kast' ) {
106
+ steps {
107
+ sh '''
108
+ make test-parse TEST_CONCRETE_BACKEND=ocaml
109
+ '''
110
+ }
111
+ }
112
+ stage(' Failing tests' ) {
113
+ steps {
114
+ sh '''
115
+ make test-failure TEST_CONCRETE_BACKEND=ocaml
116
+ make test-failure TEST_CONCRETE_BACKEND=llvm
117
+ '''
118
+ }
119
+ }
120
+ stage(' Java KLab' ) {
121
+ steps {
122
+ sh '''
123
+ make test-klab-prove TEST_SYMBOLIC_BACKEND=java
124
+ '''
125
+ }
126
+ }
127
+ stage(' KEVM help' ) {
128
+ steps {
129
+ sh '''
130
+ ./kevm help
131
+ '''
132
+ }
133
+ }
99
134
}
100
135
}
101
- stage(' OCaml kast' ) {
102
- steps {
103
- sh '''
104
- make test-parse TEST_CONCRETE_BACKEND=ocaml
105
- '''
106
- }
136
+ }
137
+ }
138
+ stage(' Deploy' ) {
139
+ when {
140
+ not { changeRequest() }
141
+ branch ' master'
142
+ beforeAgent true
143
+ }
144
+ agent { label ' docker' }
145
+ options { skipDefaultCheckout() }
146
+ environment {
147
+ GITHUB_TOKEN = credentials(' rv-jenkins' )
148
+ RELEASE_ID = ' 1.0.0'
149
+ }
150
+ stages {
151
+ stage(' Checkout SCM' ) {
152
+ steps { dir(" kevm-${ env.RELEASE_ID} " ) { checkout scm } }
107
153
}
108
- stage(' Failing tests' ) {
154
+ stage(' Build Ubuntu Package' ) {
155
+ agent {
156
+ dockerfile {
157
+ dir " kevm-${ env.RELEASE_ID} /package"
158
+ filename ' Dockerfile.ubuntu-bionic'
159
+ reuseNode true
160
+ }
161
+ }
109
162
steps {
110
- sh '''
111
- make test-failure TEST_CONCRETE_BACKEND=ocaml
112
- make test-failure TEST_CONCRETE_BACKEND=llvm
113
- '''
163
+ dir(" kevm-${ env.RELEASE_ID} " ) {
164
+ sh '''
165
+ sudo apt update && sudo apt upgrade --yes
166
+ cp -r package/debian ./
167
+ dpkg-buildpackage --no-sign
168
+ '''
169
+ }
170
+ stash name : ' bionic' , includes : " kevm_${ env.RELEASE_ID} _amd64.deb"
114
171
}
115
172
}
116
- stage(' Java KLab' ) {
173
+ stage(' Build Arch Package' ) {
174
+ agent {
175
+ dockerfile {
176
+ dir " kevm-${ env.RELEASE_ID} /package"
177
+ filename ' Dockerfile.arch'
178
+ additionalBuildArgs ' --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
179
+ reuseNode true
180
+ }
181
+ }
117
182
steps {
118
- sh '''
119
- make test-klab-prove TEST_SYMBOLIC_BACKEND=java
120
- '''
183
+ dir(" kevm-${ env.RELEASE_ID} " ) {
184
+ sh '''
185
+ sudo pacman -Syu
186
+ cd package
187
+ makepkg --noconfirm --syncdeps
188
+ '''
189
+ }
190
+ stash name : ' arch' , includes : " kevm-${ env.RELEASE_ID} /package/kevm-git-${ env.RELEASE_ID} -1-x86_64.pkg.tar.xz"
121
191
}
122
192
}
123
- stage(' KEVM help' ) {
193
+ stage(' Upload Packages' ) {
194
+ agent {
195
+ dockerfile {
196
+ dir ' package'
197
+ filename ' Dockerfile.arch'
198
+ reuseNode true
199
+ }
200
+ }
124
201
steps {
202
+ unstash ' bionic'
203
+ unstash ' arch'
125
204
sh '''
126
- ./kevm help
205
+ git_commit=$(cd kevm-$RELEASE_ID && git rev-parse --short HEAD)
206
+ hub release create \
207
+ --attach "kevm_${RELEASE_ID}_amd64.deb#Ubuntu Bionic (18.04) Package" \
208
+ --attach "kevm-${RELEASE_ID}/package/kevm-git-${RELEASE_ID}-1-x86_64.pkg.tar.xz#Arch Package" \
209
+ --message "$(echo -e "KEVM Release $RELEASE_ID - $git_commit\n\n " ; cat kevm-${RELEASE_ID}/INSTALL.md ;)" \
210
+ --commitish $(git rev-parse HEAD) "v$RELEASE_ID-$git_commit"
127
211
'''
128
212
}
129
213
}
130
214
}
215
+ post {
216
+ failure {
217
+ slackSend color : ' #cb2431' \
218
+ , channel : ' #kevm' \
219
+ , message : " KEVM Packaging Failed: ${ env.BUILD_URL} "
220
+ }
221
+ }
131
222
}
132
223
}
133
224
}
0 commit comments