-
Notifications
You must be signed in to change notification settings - Fork 707
/
Jenkinsfile.serial
140 lines (125 loc) · 3.87 KB
/
Jenkinsfile.serial
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
#!groovy
/*
This Jenkins job compiles and tests deal.II with MPI enabled
See https://ci.tjhei.info/job/dealii-serial/ for details.
*/
/*
Settings to apply inside Jenkins:
- discover pull requests (remove branches/master)
- Strategy: merged PR
- enable "Disable GitHub Multibranch Status Plugin"
- trigger build on pull request comment: .* /rebuild.* (without space!)
- Jenkinsfile: choose contrib/ci/Jenkinsfile.serial
- scan: every 4 hours
- discard: 5+ items
*/
// load library https://github.com/tjhei/jenkins-stuff to provide
// killold.killOldBuilds() function:
@Library('tjhei') _
pipeline
{
agent none
stages
{
stage("abort old")
{
agent none
steps
{
githubNotify context: 'Jenkins: serial', description: 'initializing...', status: 'PENDING'
// kill older builds in this PR:
script { killold.killOldBuilds() }
}
}
stage("main")
{
agent
{
docker
{
image 'tjhei/candi:v9.4.1-r1-ubuntu20.04'
}
}
post { cleanup { cleanWs() } }
stages
{
stage("check")
{
when {
not {
anyOf {
branch 'master'
branch pattern: "dealii-*", comparator: "GLOB"
}
}
}
steps
{
githubNotify context: 'Jenkins: serial', description: 'pending...', status: 'PENDING'
sh '''
wget -q -O - https://api.github.com/repos/dealii/dealii/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; }
'''
}
post
{
failure
{
githubNotify context: 'Jenkins: serial', description: 'need ready to test label and /rebuild', status: 'PENDING'
script
{
currentBuild.result='NOT_BUILT'
}
}
}
}
stage('build')
{
steps
{
timeout(time: 5, unit: 'HOURS')
{
sh "echo \"building on node ${env.NODE_NAME}\""
sh '''#!/bin/bash
set -e
set -x
export TEST_TIME_LIMIT=1200
export NP=`grep -c ^processor /proc/cpuinfo`
mkdir -p /home/dealii/build
cd /home/dealii/build
cmake -G "Ninja" \
-D DEAL_II_CXX_FLAGS='-Werror' \
-D DEAL_II_CXX_FLAGS_DEBUG='-Og' \
-D DEAL_II_EARLY_DEPRECATIONS=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D DEAL_II_WITH_ADOLC=OFF \
-D DEAL_II_WITH_MPI=OFF \
-D DEAL_II_UNITY_BUILD=ON \
$WORKSPACE/
time ninja -j 10 # 12 gives OOM
time ninja test # quicktests
time ninja setup_tests
time ctest --output-on-failure -j $NP --no-compress-output -T test
'''
githubNotify context: 'Jenkins: serial', description: 'OK', status: 'SUCCESS'
}
}
post
{
always
{
sh "cp /home/dealii/build/Testing/*/*.xml $WORKSPACE/.xml || true"
xunit tools: [CTest(pattern: '*.xml')]
sh "cp /home/dealii/build/detailed.log $WORKSPACE/detailed-serial.log || true"
archiveArtifacts artifacts: 'detailed-serial.log', fingerprint: true
}
failure
{
githubNotify context: 'Jenkins: serial', description: 'build failed', status: 'FAILURE'
}
}
}
}
}
}
}