forked from jenkins-docs/simple-python-pyinstaller-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
43 lines (40 loc) · 2.05 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
pipeline {
agent any
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '7', numToKeepStr: '10')
disableConcurrentBuilds()
}
stages {
stage('Build') {
steps {
sh 'pipenv --three ' // install virtual environment
sh 'pipenv install --dev' // set up that this is also a dev environment
sh 'pipenv run pytest --verbose --junit-xml test-reports/results.xml sources/test_calc.py --html=test-reports/report.html --cov-report html:cov-reports --cov-report xml:cov-reports/cov.xml --cov=sources/ sources/' //run pytest in our pipenv
}
post {
always {
junit 'test-reports/results.xml' // always publish the results of the test
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'cov-reports/cov.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'test-reports',
reportFiles: 'report.html',
reportTitles: "Test Report",
reportName: "Test Report"
])
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'cov-reports',
reportFiles: 'index.html',
reportTitles: "Coverage Report",
reportName: "Coverage Report"
])
}
}
}
}
}