-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
63 lines (61 loc) · 2.08 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
pipeline {
options { ansiColor('xterm') }
agent {
dockerfile {
label 'docker'
additionalBuildArgs '--build-arg K_COMMIT=$(cd deps/k && git rev-parse --short=7 HEAD)'
}
}
stages {
stage('Init title') {
when { changeRequest() }
steps { script { currentBuild.displayName = "PR ${env.CHANGE_ID}: ${env.CHANGE_TITLE}" } }
}
stage('Build') { steps { sh 'make KOMPILE_OPTS=--coverage build -j2' } }
stage('Split Tests') { steps { sh 'make test-split' } }
stage('Test') { steps { sh 'make test -j8' } }
stage('Publish to Jenkins') {
steps {
sh '''
kcovr .build/defn/llvm-minimal/beacon-chain-kompiled \
-- .build/defn/llvm-minimal/*.k \
> coverage.xml
'''
cobertura coberturaReportFile: 'coverage.xml'
sh 'make sphinx'
stash name: 'html_docs', includes: '.build/sphinx-docs/html/**/*'
publishHTML (target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: '.build/sphinx-docs/html',
reportFiles: 'index.html',
reportName: "Semantics (HTML)"
])
}
}
stage('Deploy documentation to GitHub Pages') {
when { branch 'master' }
options { skipDefaultCheckout() }
post {
failure {
slackSend color: '#cb2431' \
, channel: '#beacon-chain-internal' \
, message: "Deploy failure: ${env.BUILD_URL}"
}
}
steps {
unstash 'html_docs'
dir('gh-pages') { sshagent(['2b3d8d6b-0855-4b59-864a-6b3ddf9c9d1a']) {
git branch: 'gh-pages', url: '[email protected]:runtimeverification/beacon-chain-spec'
sh '''
cp -rf ../.build/sphinx-docs/html/* .
git add --all
git commit -am "Updating public documentation." || true
git push --set-upstream origin gh-pages
'''
} }
}
}
}
}