-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
119 lines (114 loc) · 4.26 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@Library('[email protected]') _
pipeline {
agent none
environment {
HOME = '.'
}
stages {
stage("Test") {
agent {
docker {
label 'windows-slave'
image 'ingeniacontainers.azurecr.io/win-python-builder:1.1'
}
}
stages {
stage("Install Dependencies") {
steps {
bat """
py -3.9 -m pipenv install -d --ignore-pipfile
"""
}
}
stage("Code checks") {
parallel {
stage('Mypy') {
steps {
bat """
py -3.9 -m pipenv run mypy ./k2basecamp --config-file mypy.ini --junit-xml=mypy_junit.xml
"""
}
post {
always {
junit "mypy_junit.xml"
}
}
}
stage("Formatting") {
steps {
bat """
py -3.9 -m pipenv run black ./k2basecamp --check
"""
}
}
stage("Linting") {
steps {
bat """
py -3.9 -m pipenv run ruff ./k2basecamp --output-format=junit --output-file=ruff_junit.xml
"""
}
post {
always {
junit "ruff_junit.xml"
}
}
}
stage("QML Linting") {
steps {
bat """
py -3.9 -m pipenv run pyside6-project build
"""
bat """
py -3.9 -m pipenv run qmllinting.py
"""
}
}
}
}
stage("Tests") {
stages {
stage("Unit Tests") {
steps {
bat """
py -3.9 -m pipenv run pytest ./tests/unit --junitxml=pytest_unit_junit.xml
"""
}
post {
always {
junit "pytest_unit_junit.xml"
}
}
}
stage("GUI Tests") {
steps {
bat """
py -3.9 -m pipenv run pytest ./tests/gui --junitxml=pytest_gui_junit.xml
"""
}
post {
always {
junit "pytest_gui_junit.xml"
}
}
}
}
}
stage("Generate documentation") {
steps {
bat """
py -3.9 -m pipenv run python -m sphinx -b html docs/source _docs
"""
}
}
stage('Archive') {
steps {
bat """
"C:\\Program Files\\7-Zip\\7z.exe" a -r docs.zip -w _docs -mem=AES256
"""
archiveArtifacts artifacts: "dist\\*, docs.zip"
}
}
}
}
}
}