-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
64 lines (60 loc) · 1.8 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
63
64
pipeline {
agent any
options {
ansiColor('xterm')
}
stages {
stage('build') {
steps {
script {
sh '''
python3 -m pip install -U pip
python3 -m pip install -U poetry
python3 -m poetry config virtualenvs.in-project true
python3 -m poetry install --with=dev
python3 -m poetry build
'''
}
}
}
stage('lint') {
// disable
when { expression { false } }
steps {
script {
sh '''
python3 -m poetry run python -m pylint --rcfile=pylintrc resticrc > pylint.log
python3 -m poetry run python -m mypy resticrc > mypy.log
'''
}
}
post {
always {
script {
recordIssues(tools: [pyLint(pattern: 'pylint.log'), myPy(pattern: 'mypy.log')])
}
}
}
}
stage('test') {
steps {
sh 'python3 -m poetry run pytest -v --cov=resticrc --junit-xml=report.xml'
}
post {
always {
script {
if(fileExists('report.xml')) junit testResults: 'report.xml', skipPublishingChecks: true
publishHTML([reportDir: 'htmlcov', reportFiles: 'index.html', reportName: 'Coverage report'])
}
}
}
}
}
post {
cleanup {
script {
cleanWs disableDeferredWipeout: true
}
}
}
}