forked from xmos/lib_i2s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
115 lines (110 loc) · 3.2 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
@Library('[email protected]') _
getApproval()
pipeline {
agent none
//Tools for AI verif stage. Tools for standard stage in view file
parameters {
string(
name: 'TOOLS_VERSION',
defaultValue: '15.1.4',
description: 'The tools version to build with (check /projects/tools/ReleasesTools/)'
)
}
stages {
stage('Standard build and XS2 tests') {
agent {
label 'x86_64&&macOS'
}
environment {
REPO = 'lib_i2s'
VIEW = getViewName(REPO)
}
options {
skipDefaultCheckout()
}
stages {
stage('Get view') {
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
}
}
stage('Library checks') {
steps {
xcoreLibraryChecks("${REPO}")
}
}
stage('xCORE builds') {
steps {
dir("${REPO}") {
xcoreAllAppsBuild('examples')
xcoreAllAppNotesBuild('examples')
dir('examples/AN00162_i2s_loopback_demo'){
runXmake(".", "", "XCOREAI=1")
stash name: 'AN00162', includes: 'bin/XCORE_AI/AN00162_i2s_loopback_demo.xe, '
}
dir("${REPO}") {
runXdoc('doc')
}
}
}
}
stage('Tests') {
steps {
dir('lib_i2s/tests/backpressure_test'){
runXmake(".", "", "CONFIG=XCORE_AI")
stash name: 'backpressure_test', includes: 'bin/XCORE_AI/backpressure_test_XCORE_AI.xe, '
}
dir("${REPO}/tests") {
viewEnv {
runPytest()
}
}
}
}
}// stages
post {
cleanup {
xcoreCleanSandbox()
}
}
}// Stage standard build
stage('xcore.ai Verification'){
agent {
label 'xcore.ai'
}
stages{
stage('xrun'){
steps{
withTools(params.TOOLS_VERSION) { // load xmos tools
//Just run on HW and error on incorrect binary etc. We need specific HW for it to run so just check it loads OK
unstash 'AN00162'
sh 'xrun --id 0 bin/XCORE_AI/AN00162_i2s_loopback_demo.xe'
//Just run on HW and error on incorrect binary etc. It will not run otherwise due to lack of loopback (intended for sim)
//We run xsim afterwards for actual test (with loopback)
unstash 'backpressure_test'
sh 'xrun --id 0 bin/XCORE_AI/backpressure_test_XCORE_AI.xe'
sh 'xsim bin/XCORE_AI/backpressure_test_XCORE_AI.xe --plugin LoopbackPort.dll "-port tile[0] XS1_PORT_1G 1 0 -port tile[0] XS1_PORT_1A 1 0" > bp_test.txt'
sh 'cat bp_test.txt && diff bp_test.txt tests/expected/backpressure_test.expect'
}
}
}
}//stages
post {
cleanup {
cleanWs()
}
}
}// xcore.ai
stage('Update view files') {
agent {
label 'x86_64&&macOS'
}
when {
expression { return currentBuild.currentResult == "SUCCESS" }
}
steps {
updateViewfiles()
}
}
}
}