Repository navigation
Expand file tree
/
Copy pathJenkinsfile
More file actions
108 lines (91 loc) · 3.11 KB
/
Copy pathJenkinsfile
File metadata and controls
108 lines (91 loc) · 3.11 KB
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
pipeline {
agent none
stages {
stage("check") {
agent {
docker {
image 'dealii/dealii:v9.6.0-jammy'
}
}
// 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.6") {
agent {
docker {
image 'dealii/dealii:v9.6.0-jammy'
}
}
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.5") {
agent {
docker {
image 'dealii/dealii:v9.5.1-jammy'
}
}
stages {
stage("indent") {
steps {
sh './contrib/install-astyle'
sh 'PATH=${HOME}/bin:{$PATH} ./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() } }
}
}
}