forked from tjhei/cracks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
171 lines (144 loc) · 4.55 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
pipeline {
agent none
stages {
stage("check") {
agent {
docker {
image 'tjhei/dealii:v8.5.1-full-v8.5.1-r1-gcc5'
}
}
// skip this if it is not a pull request:
when { expression { env.CHANGE_ID != null } }
steps {
githubNotify context: 'CI', description: 'need ready to test label and /rebuild', status: 'PENDING'
// For /rebuild to work you need to:
// 1) select "issue comment" to be delivered in the github webhook setting
// 2) install "GitHub PR Comment Build Plugin" on Jenkins
// 3) in project settings select "add property" "Trigger build on pr comment" with
// the phrase ".*/rebuild.*" (without quotes)
sh '''
wget -q -O - https://api.github.com/repos/tjhei/cracks/issues/${CHANGE_ID}/labels | grep 'ready to test' || \
{ echo "This commit will only be tested when it has the label 'ready to test'. Trigger a rebuild by adding a comment that contains '/rebuild'..."; exit 1; }
'''
githubNotify context: 'CI', description: 'running tests...', status: 'PENDING'
}
}
stage ("9.0") {
agent {
docker {
image 'tjhei/dealii:v9.0.1-full-v9.0.1-r5-gcc5'
}
}
stages {
stage("indent") {
steps {
sh './contrib/indent'
sh 'git diff > changes.diff'
archiveArtifacts artifacts: 'changes.diff', fingerprint: true
sh '''
git diff --exit-code || \
{ echo "Please check indentation!"; exit 1; }
'''
githubNotify context: 'indent', description: '', status: 'SUCCESS'
}
}
stage("build") {
steps {
sh 'cmake -D CMAKE_CXX_FLAGS="-Werror" .'
sh 'make -j 4'
}
}
stage('test') {
steps {
sh './cracks'
}
}
}
post { cleanup { cleanWs() } }
}
stage ("9.1") {
agent {
docker {
image 'tjhei/dealii:v9.1.1-full-v9.1.1-r1-clang6'
}
}
stages {
stage("build") {
steps {
sh 'cmake -D CMAKE_CXX_FLAGS="-Werror" .'
sh 'make -j 4'
}
}
stage('test') {
steps {
sh './cracks'
}
}
}
post { cleanup { cleanWs() } }
}
stage ("9.2") {
agent {
docker {
image 'tjhei/dealii:v9.2.0-full-v9.2.0-r2-gcc5'
}
}
stages {
stage("build") {
steps {
sh 'cmake -D CMAKE_CXX_FLAGS="-Werror" .'
sh 'make -j 4'
}
}
stage('test') {
steps {
sh './cracks'
}
}
}
post { cleanup { cleanWs() } }
}
stage ("9.4") {
agent {
docker {
image 'tjhei/dealii:v9.4.2-full-v9.4.2-r3-ubuntu20.04'
}
}
stages {
stage("indent") {
steps {
sh './contrib/indent'
sh 'git diff > changes.diff'
archiveArtifacts artifacts: 'changes.diff', fingerprint: true
sh '''
git diff --exit-code || \
{ echo "Please check indentation!"; exit 1; }
'''
githubNotify context: 'indent', description: '', status: 'SUCCESS'
}
}
stage("build") {
steps {
sh 'cmake -D CMAKE_CXX_FLAGS="-Werror" .'
sh 'make -j 4'
}
}
stage('test') {
steps {
sh './cracks'
sh 'ctest --output-on-failure || { touch FAILED; cat tests/output-*/*diff >test.diff; } '
archiveArtifacts artifacts: 'test.diff', fingerprint: true, allowEmptyArchive: true
sh 'ctest --output-on-failure'
sh 'if [ -f FAILED ]; then exit 1; fi'
}
}
stage("end") {
steps {
githubNotify context: 'CI', description: 'success!', status: 'SUCCESS'
}
}
}
post { cleanup { cleanWs() } }
}
}
}