forked from naliboff/aspect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
112 lines (103 loc) · 3.27 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
#!groovy
pipeline {
agent {
docker {
image 'dealii/dealii:v8.5.1-gcc-mpi-fulldepscandi-debugrelease'
label 'has-docker'
}
}
options {
timeout(time: 2, unit: 'HOURS')
}
parameters {
booleanParam(defaultValue: false, description: 'Is the pull request approved for testing?', name: 'TRUST_BUILD')
}
stages {
stage ("info") {
steps {
echo "PR: ${env.CHANGE_ID} - ${env.CHANGE_TITLE}"
echo "CHANGE_AUTHOR_EMAIL: ${env.CHANGE_AUTHOR_EMAIL}"
echo "CHANGE_AUTHOR: ${env.CHANGE_AUTHOR}"
echo "CHANGE_AUTHOR_DISPLAY_NAME: ${env.CHANGE_AUTHOR_DISPLAY_NAME}"
echo "building on node ${env.NODE_NAME}"
}
}
stage ("Check permissions") {
when {
allOf {
environment name: 'TRUST_BUILD', value: 'false'
not {branch 'master'}
not {changeRequest authorEmail: "[email protected]"}
not {changeRequest authorEmail: "[email protected]"}
not {changeRequest authorEmail: "[email protected]"}
not {changeRequest authorEmail: "[email protected]"}
not {changeRequest authorEmail: "[email protected]"}
not {changeRequest authorEmail: "[email protected]"}
not {changeRequest authorEmail: "[email protected]"}
not {changeRequest authorEmail: "[email protected]"}
}
}
steps {
echo "Please ask an admin to rerun jenkins with TRUST_BUILD=true"
sh "exit 1"
}
}
stage('Check indentation') {
steps {
sh './doc/indent'
sh 'git diff > changes-astyle.diff'
archiveArtifacts artifacts: 'changes-astyle.diff', fingerprint: true
sh '''
git diff --exit-code || \
{ echo "Please check indentation, see artifacts in the top right corner!"; exit 1; }
'''
}
}
stage('Build') {
options {timeout(time: 15, unit: 'MINUTES')}
steps {
sh '''
export NP=`grep -c ^processor /proc/cpuinfo`
mkdir -p /home/dealii/build-gcc-fast
cd /home/dealii/build-gcc-fast
cmake -G "Ninja" \
-D DEAL_II_CXX_FLAGS='-Werror' \
-D ASPECT_TEST_GENERATOR=Ninja \
-D ASPECT_USE_PETSC=OFF \
-D ASPECT_RUN_ALL_TESTS=ON \
-D ASPECT_PRECOMPILE_HEADERS=ON \
$WORKSPACE/
ninja -j $NP
'''
}
}
stage('Prebuild tests') {
options {timeout(time: 90, unit: 'MINUTES')}
steps {
sh '''
export OMPI_MCA_btl=self,tcp
cd /home/dealii/build-gcc-fast/tests
echo "Prebuilding tests..."
ninja -k 0 tests || true
'''
}
}
stage('Run tests') {
options {timeout(time: 90, unit: 'MINUTES')}
steps {
sh '''
export OMPI_MCA_btl=self,tcp
rm -f /home/dealii/build-gcc-fast/FAILED
cd /home/dealii/build-gcc-fast
ctest --output-on-failure -j4 || { touch FAILED; }
echo "Generating reference output..."
ninja generate_reference_output
'''
sh 'git diff tests > changes-test-results.diff'
archiveArtifacts artifacts: 'changes-test-results.diff', fingerprint: true
sh 'if [ -f /home/dealii/build-gcc-fast/FAILED ]; then exit 1; fi'
sh 'git diff --exit-code --name-only'
}
}
}
}