-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
64 lines (64 loc) · 1.89 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 {
dockerfile {
filename 'Dockerfile.build'
}
}
stages {
stage('Install') {
steps {
// Install all extras along with the dependencies in
// poetry's virtual environment.
sh 'poetry install --all-extras'
}
}
stage('Quality assurance') {
parallel {
stage('Lint (ruff)') {
steps {
sh 'poetry run task ruff'
}
}
stage('Check types (mypy)') {
steps {
sh 'poetry run task mypy'
}
}
}
}
stage('Quality control') {
stages {
stage('Test (pytest)') {
steps {
sh 'poetry run pytest --junitxml=junit.xml'
}
post {
always {
// Parse JUnit XML files
junit 'junit.xml'
}
}
}
stage('Coverage (pytest-cov)') {
environment {
// Get total coverage for the badge
TOTAL_COVERAGE=sh(script: 'poetry run pytest --cov=cyto tests | grep TOTAL | awk \'{print $4 "\\t"}\'', returnStdout: true).trim()
}
steps {
sh ''
}
post {
always {
addShortText text: "Coverage: ${env.TOTAL_COVERAGE}"
}
}
}
}
}
stage('Build') {
steps {
sh 'poetry build'
}
}
}
}