blob: f4f3325439e1afea48736196c85426c6a7e35adc [file] [log] [blame]
Lijing Wange84adea2015-05-31 16:25:16 -07001#!/usr/bin/env groovy
Alexander Afanasyeva9369b42017-01-11 11:58:00 -08002
Lijing Wange84adea2015-05-31 16:25:16 -07003stage 'Starting CI check'
Alexander Afanasyeva9369b42017-01-11 11:58:00 -08004node {
Alexander Afanasyeva9369b42017-01-11 11:58:00 -08005}
6
7//////////////////////
8
9stage 'Parallel builds'
10
11def labels = [
12 "OSX-10.12",
13 "Ubuntu-16.04-64bit",
Lijing Wange84adea2015-05-31 16:25:16 -070014 "code-coverage",
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080015]
16
17def builds = [:]
18
19// Apparently, cannot use for-loop iteration, see https://issues.jenkins-ci.org/browse/JENKINS-27421
20for (int i = 0; i < labels.size(); i++) {
Lijing Wange84adea2015-05-31 16:25:16 -070021 String label = labels.get(i);
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080022
Lijing Wange84adea2015-05-31 16:25:16 -070023 builds[label] = {
24 node(label) {
25 wrap([$class: 'hudson.plugins.ansicolor.AnsiColorBuildWrapper', colorMapName: 'xterm']) {
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080026
Lijing Wange84adea2015-05-31 16:25:16 -070027 deleteDir()
28 git url: 'https://gerrit.named-data.net/ChronoShare'
29 sh "git fetch origin ${GERRIT_REFSPEC} && git checkout FETCH_HEAD"
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080030
Lijing Wange84adea2015-05-31 16:25:16 -070031 withEnv(["NODE_LABELS=\"$label\""]) {
32 sh "./.jenkins"
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080033 }
Lijing Wange84adea2015-05-31 16:25:16 -070034
35 if (label == "code-coverage") {
36 publishHTML(target: [
37 allowMissing: false,
38 alwaysLinkToLastBuild: false,
39 keepAll: true,
40 reportDir: 'build/coverage',
41 reportFiles: 'index.html',
42 reportName: "GCOVR Coverage Report"
43 ])
44 // CoverturaPublisher is not yet supported by pipelines, see https://issues.jenkins-ci.org/browse/JENKINS-30700
45 // step([$class: 'CoberturaPublisher',
46 // coberturaReportFile: 'build/coverage.xml',
47 // autoUpdateHealth: false, autoUpdateStability: false, zoomCoverageChart: true,
48 // failNoReports: true, failUnhealthy: false, failUnstable: false,
49 // maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'UTF-8'])
50 } else {
51 // don't publish test results for code coverage run
52 step([$class: 'XUnitBuilder',
53 testTimeMargin: '50000', thresholdMode: 1,
54 tools: [[$class: 'BoostTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true,
55 pattern: 'build/xunit*.xml', skipNoTestFiles: true, stopProcessingIfError: true]]])
56 }
57 }
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080058 }
Lijing Wange84adea2015-05-31 16:25:16 -070059 }
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080060}
61
62parallel builds