-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathJenkinsfile
More file actions
150 lines (133 loc) · 3.6 KB
/
Jenkinsfile
File metadata and controls
150 lines (133 loc) · 3.6 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
@Library('xmos_jenkins_shared_library@v0.43.1') _
def runningOn(machine) {
println "Stage running on:"
println machine
}
getApproval()
pipeline {
agent none
environment {
REPO = 'lib_camera'
REPO_NAME = "lib_camera"
} // environment
parameters {
string(
name: 'TOOLS_VERSION',
defaultValue: '15.3.1',
description: 'The XTC tools version'
)
string(
name: 'XMOSDOC_VERSION',
defaultValue: 'v7.3.0',
description: 'The xmosdoc version'
)
string(
name: 'INFR_APPS_VERSION',
defaultValue: 'v3.1.1',
description: 'The infr_apps version'
)
} // parameters
options {
skipDefaultCheckout()
timestamps()
buildDiscarder(xmosDiscardBuildSettings(onlyArtifacts=false))
} // options
stages{
stage('CI') {
parallel {
stage ('Build & Test') {
agent {label 'xcore.ai'}
post {cleanup {xcoreCleanSandbox()}}
stages {
stage('Checkout') {
steps {
runningOn(env.NODE_NAME)
dir(REPO)
{
checkoutScmShallow()
createVenv(reqFile: "requirements.txt")
}
} // steps
} // Checkout
stage('Examples build') {
steps{
dir("${REPO}/examples") {
withVenv {
xcoreBuild()
}
}
}
} // Examples build
stage('Tests build') {
steps{
dir("${REPO}/tests") {
withVenv {
xcoreBuild()
}
}
}
} // Tests build
stage("Repo checks"){ // Needs to be placed after build stage for dependancies to be built
steps {
dir("${REPO}") {
withVenv {
runRepoChecks("${WORKSPACE}/${REPO}")
}
}
}
} // Lib checks
stage('Unit tests') {
steps {
dir("${REPO}/tests/unit_tests") {
withTools(params.TOOLS_VERSION) {
sh 'xsim bin/unit_tests.xe'
}
}
}
} // Unit tests
stage('ISP tests') {
steps {
dir('lib_camera/tests/isp') {
withVenv {
withTools(params.TOOLS_VERSION) {
sh 'pytest -n auto'
} // withTools
archiveArtifacts artifacts: "test_results.csv"
archiveArtifacts artifacts: "imgs/images.zip"
}
}
}
} // ISP tests
stage("Archive sandbox"){
steps {
archiveSandbox(REPO_NAME)
}
} // Archive sandbox
} // stages
} // Build & Test
stage('Documentation') {
agent {label 'documentation'}
post {cleanup {xcoreCleanSandbox()}}
steps{
runningOn(env.NODE_NAME)
dir("${REPO}") {
checkoutScmShallow()
createVenv(reqFile: "requirements.txt")
withVenv {
buildDocs()
}
}
}
} // Documentation
} // parallel
} // CI
stage('🚀 Release') {
when {
expression {triggerRelease.isReleasable() }
}
steps {
triggerRelease()
}
} // Release
} // stages
} // pipeline