forked from input-output-hk/theseus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
theseus.pipeline
94 lines (91 loc) · 2.64 KB
/
theseus.pipeline
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
pipeline {
agent any
stages {
stage("Checking out source code") {
steps {
checkout(
[
$class: 'GitSCM', branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs:
[
[
credentialsId: 'IOHK-QA',
url: 'https://github.com/input-output-hk/theseus'
]
]
]
)
}
}
stage("Assign Version Number") {
steps {
sh '''
# patch in the build number
perl -pi -e "s/Source/$BUILD_NUMBER/" Theseus/version.py
'''
}
}
stage("Install dependencies") {
steps {
sh '''
# ensure we have all the specified dependencies upto date
pip3.7 install -e . --user --upgrade
'''
}
}
stage("Run unit tests") {
steps {
sh '''
# run the tests with xunit output
python3.7 /usr/bin/nosetests3 --with-xunit --xunit-file nosetests.xml --xunit-testsuite-name=Theseus -d --verbosity 2 -w Theseus/Tests/
'''
}
}
stage("Build Egg file") {
steps {
sh '''
echo "Building egg file"
python3.7 setup.py bdist_egg
echo "copying egg file"
cp dist/theseus*.egg theseus.egg
'''
}
}
stage ("Build documentation") {
steps {
sh '''
cd sphinx
make html
'''
}
}
stage("Publish documentation") {
steps {
publishHTML(
[
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: 'sphinx/build/html',
reportFiles: 'index.html',
reportName: 'Documentation',
reportTitles: ''
]
)
}
}
stage ("Archive artifacts") {
steps {
archiveArtifacts artifacts: 'theseus.egg , nosetests.xml'
}
}
stage("Publish test results") {
steps {
junit testDataPublishers: [[ $class: 'StabilityTestDataPublisher']], testResults: '**/nosetests.xml'
}
}
}
}