forked from analogdevicesinc/TransceiverToolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
133 lines (114 loc) · 4.47 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
@Library('tfc-lib') _
dockerConfig = getDockerConfig(['MATLAB','Vivado'], matlabHSPro=false)
dockerConfig.add("-e MLRELEASE=R2021b")
dockerHost = 'docker'
////////////////////////////
hdlBranches = ['master','hdl_2019_r2']
stage("Build Toolbox") {
dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) {
branchName ->
try {
withEnv(['HDLBRANCH='+branchName,'LC_ALL=C.UTF-8','LANG=C.UTF-8']) {
checkout scm
sh 'git submodule update --init'
sh 'make -C ./CI/scripts build'
sh 'pip3 install -r requirements_doc.txt'
sh 'make -C ./CI/gen_doc doc_ml'
sh 'make -C ./CI/scripts add_libad9361'
sh 'make -C ./CI/scripts gen_tlbx'
}
} catch(Exception ex) {
if (branchName == 'hdl_2019_r2') {
error('Production Toolbox Build Failed')
}
else {
unstable('Development Build Failed')
}
}
if (branchName == 'hdl_2019_r2') {
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
archiveArtifacts artifacts: 'hdl/*', followSymlinks: false, allowEmptyArchive: true
}
}
}
/////////////////////////////////////////////////////
boardNames = ['zed','zc702','zc706','zcu102','adrv9361','adrv9364','pluto']
dockerConfig.add("-e HDLBRANCH=hdl_2019_r2")
stage("HDL Tests") {
dockerParallelBuild(boardNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['BOARD='+branchName]) {
stage("Source") {
unstash "builtSources"
sh 'make -C ./CI/scripts test'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
/*
stage("Synth") {
unstash "builtSources"
sh 'make -C ./CI/scripts test_synth'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
*/
stage("Installer") {
unstash "builtSources"
sh 'make -C ./CI/scripts test_installer'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
}
}
/////////////////////////////////////////////////////
demoNames = ['HDLLoopbackDelayEstimation','HDLFrequencyHopper','HDLTuneAGC','KernelFrequencyHopper']
stage("Demo Tests") {
dockerParallelBuild(demoNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['DEMO='+branchName]) {
unstash "builtSources"
sh 'make -C ./CI/scripts test_targeting_demos'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
}
/////////////////////////////////////////////////////
appNames = ['lte_pa_app']
stage("Build Deployable Apps") {
dockerParallelBuild(appNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['APP='+branchName]) {
unstash "builtSources"
sh 'make -C ./CI/scripts ${APP}'
archiveArtifacts artifacts: 'trx_examples/streaming/LTE_PA_App/LTEPA/for_redistribution/*.exe', followSymlinks: false, allowEmptyArchive: true
archiveArtifacts artifacts: 'trx_examples/streaming/LTE_PA_App/LTEPA/for_redistribution/*.install', followSymlinks: false, allowEmptyArchive: true
}
}
}
/////////////////////////////////////////////////////
classNames = ['AD9361','AD9363','AD9364','AD9371','ADRV9009']
stage("Hardware Streaming Tests") {
dockerParallelBuild(classNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['HW='+branchName]) {
unstash "builtSources"
sh 'echo ${HW}'
// sh 'make -C ./CI/scripts test_streaming'
}
}
}
//////////////////////////////////////////////////////
node {
stage('Deploy Development') {
unstash "builtSources"
uploadArtifactory('TransceiverToolbox','*.mltbx')
}
if (env.BRANCH_NAME == 'master') {
stage('Deploy Production') {
unstash "builtSources"
uploadFTP('TransceiverToolbox','*.mltbx')
}
}
}