-
Notifications
You must be signed in to change notification settings - Fork 10
/
Jenkinsfile
178 lines (166 loc) · 4.65 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
@Library('[email protected]') _
getApproval()
pipeline {
agent none
environment {
REPO = 'lib_spi'
VIEW = getViewName(REPO)
}
options {
skipDefaultCheckout()
}
stages {
stage('Standard build and XS1/2 tests') {
agent {
label 'x86_64 && linux'
}
stages {
stage('Get view') {
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
}
}
stage('Library checks') {
steps {
xcoreLibraryChecks("${REPO}")
}
}
stage('Legacy tests') {
steps {
dir("${REPO}/legacy_tests") {
viewEnv() {
// Use Pipfile in legacy_tests, not lib_spi/Pipfile
installPipfile(true)
runPython("./runtests.py --junit-output=${REPO}_tests.xml")
}
}
}
}
stage('Build XCOREAI') {
steps {
dir("${REPO}") {
forAllMatch("examples", "AN*/") { path ->
runXmake(path, '', 'XCOREAI=1')
dir(path) {
stash name: path.split("/")[-1], includes: 'bin/*, '
}
}
// Build Tests
dir('legacy_tests/') {
script {
tests = [
"spi_master_async_multi_client",
"spi_master_async_multi_device",
"spi_master_async_rx_tx",
"spi_master_async_shutdown",
"spi_master_sync_benchmark",
"spi_master_sync_clock_port_sharing",
"spi_master_sync_multi_client",
"spi_master_sync_multi_device",
"spi_master_sync_rx_tx",
"spi_slave_benchmark",
"spi_slave_rx_tx"
]
tests.each() {
dir(it) {
//Build all tests tagetting XS3 to check for build errors only
runXmake(".", "", "XCOREAI=1")
stash name: it, includes: 'bin/**/*.xe, '
}
}
}
}
}
}
}
}//stages
post {
cleanup {
xcoreCleanSandbox()
}
}
}//stage - Standard build and XS1/2 tests
stage('Documentation'){
agent{
label 'x86_64&&macOS'
}
stages{
stage('Get view') {
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
}
}
stage('Builds') {
steps {
forAllMatch("${REPO}/examples", "AN*/") { path ->
runXdoc("${path}/doc")
}
runXdoc("${REPO}/${REPO}/doc")
// Archive all the generated .pdf docs
archiveArtifacts artifacts: "${REPO}/**/pdf/*.pdf", fingerprint: true, allowEmptyArchive: true
}
}
}
post {
cleanup {
cleanWs()
}
}
}
stage('xcore.ai Verification'){
agent {
label 'xcore.ai-explorer'
}
stages{
stage('Get view') {
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
dir("${REPO}") {
viewEnv {
withVenv {
sh "pip install -e ${WORKSPACE}/xtagctl"
sh "xtagctl reset_all XCORE-AI-EXPLORER"
}
}
}
}
}
stage('xrun'){
steps{
dir("${REPO}") {
viewEnv {
withVenv {
forAllMatch("examples", "AN*/") { path ->
unstash path.split("/")[-1]
}
// Run the tests and look for what we expect
sh 'xrun --io --id 0 bin/AN00160_using_SPI_master.xe &> AN00160_using_SPI_master.txt'
// Look for config register 0 value from wifi module
sh 'grep 2005400 AN00160_using_SPI_master.txt'
//Just run this and ensure we get no error (like wrong arch). We have no SPI master HW so cannot test it
sh 'xrun --id 0 bin/AN00161_using_SPI_slave.xe'
}
}
}
}
}
}//stages
post {
cleanup {
cleanWs()
}
}
}// xcore.ai
stage('Update view files') {
agent {
label 'x86_64 && linux'
}
when {
expression { return currentBuild.currentResult == "SUCCESS" }
}
steps {
updateViewfiles()
}
}
}//stages
}//pipeline