forked from xmos/lib_xua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
186 lines (184 loc) · 4.81 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
179
180
181
182
183
184
185
186
@Library('[email protected]') _
getApproval()
pipeline {
agent none
environment {
REPO = 'lib_xua'
VIEW = getViewName(REPO)
TOOLS_VERSION = "15.2.1" // For unit tests
}
options {
skipDefaultCheckout()
}
stages {
stage('Basic tests') {
agent {
label 'x86_64 && linux'
}
stages {
stage('Get view') {
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
}
}
stage('Library checks') {
steps {
xcoreLibraryChecks("${REPO}", false)
}
}
stage('Testing') {
failFast true
parallel {
stage('Tests') {
steps {
dir("${REPO}/tests"){
viewEnv(){
withVenv{
sh "xmake -C test_midi -j" // Xdist does not like building so do here
runPytest('--numprocesses=auto -vvv')
}
}
}
}
}
stage('Unity tests') {
steps {
dir("${REPO}/tests/xua_unit_tests") {
withTools("${env.TOOLS_VERSION}") {
withVenv {
withEnv(["XMOS_CMAKE_PATH=${WORKSPACE}/xcommon_cmake"]) {
sh "cmake -G 'Unix Makefiles' -B build"
sh 'xmake -C build -j'
runPython("pytest -s --junitxml=pytest_unity.xml")
junit "pytest_unity.xml"
}
}
}
}
}
}
}
}
stage('xCORE builds') {
steps {
dir("${REPO}") {
xcoreAllAppNotesBuild('examples')
dir("${REPO}") {
runXdoc('doc')
}
}
// Archive all the generated .pdf docs
archiveArtifacts artifacts: "${REPO}/**/pdf/*.pdf", fingerprint: true, allowEmptyArchive: true
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build host apps') {
failFast true
parallel {
stage('Build Linux host app') {
agent {
label 'x86_64&&linux'
}
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
dir("${REPO}/${REPO}/host/xmosdfu") {
sh 'make -f Makefile.Linux64'
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build Mac host app') {
agent {
label 'x86_64&&macOS'
}
steps {
xcorePrepareSandbox("${VIEW}", "${REPO}")
dir("${REPO}/${REPO}/host/xmosdfu") {
sh 'make -f Makefile.OSX64'
}
dir("${REPO}/host_usb_mixer_control") {
sh 'make -f Makefile.OSX'
sh 'mkdir OSX/x86'
sh 'mv xmos_mixer OSX/x86/xmos_mixer'
archiveArtifacts artifacts: "OSX/x86/xmos_mixer", fingerprint: true
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build Pi host app') {
agent {
label 'pi'
}
steps {
dir("${REPO}") {
checkout scm
dir("${REPO}/host/xmosdfu") {
sh 'make -f Makefile.Pi'
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Build Windows host app') {
agent {
label 'x86_64&&windows'
}
steps {
dir("${REPO}") {
checkout scm
dir("${REPO}/host/xmosdfu") {
withVS("vcvars32.bat") {
bat "nmake /f Makefile.Win32"
}
}
dir("host_usb_mixer_control") {
withVS() {
bat 'msbuild host_usb_mixer_control.vcxproj /property:Configuration=Release /property:Platform=x64'
}
bat 'mkdir Win\\x64'
bat 'mv bin/Release/x64/host_usb_mixer_control.exe Win/x64/xmos_mixer.exe'
archiveArtifacts artifacts: "Win/x64/xmos_mixer.exe", fingerprint: true
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
}
}
stage('Update') {
agent {
label 'x86_64 && linux'
}
steps {
updateViewfiles()
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
}
}