-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathJenkinsfile
155 lines (133 loc) · 4.84 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
@Library('tfc-lib') _
flags = gitParseFlags()
dockerConfig = getDockerConfig(['MATLAB','Vivado'], matlabHSPro=false)
dockerConfig.add("-e MLRELEASE=R2023b")
dockerHost = 'docker'
////////////////////////////
hdlBranches = ['main','hdl_2022_r2']
stage("Build Toolbox") {
dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) {
branchName ->
try {
withEnv(['HDLBRANCH='+branchName]) {
checkout scm
sh 'git submodule update --init'
sh 'pip3 install -r ./CI/gen_doc/requirements_doc.txt'
sh 'make -C ./CI/gen_doc doc_ml'
sh 'make -C ./CI/scripts build'
sh 'make -C ./CI/scripts gen_tlbx'
}
} catch(Exception ex) {
if (branchName == 'hdl_2022_r2') {
error('Production Toolbox Build Failed')
}
else {
unstable('Development Build Failed')
}
}
if (branchName == 'hdl_2022_r2') {
archiveArtifacts artifacts: '*.mltbx'
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
}
}
}
/////////////////////////////////////////////////////
boardNames = ['daq2','ad9081','ad9434','ad9739a','ad9265', 'fmcjesdadc1','ad9783']
dockerConfig.add("-e HDLBRANCH=hdl_2022_r2")
cstage("HDL Tests", "", flags) {
dockerParallelBuild(boardNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['BOARD='+branchName]) {
cstage("Source", branchName, flags) {
unstash "builtSources"
sh 'make -C ./CI/scripts test'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
cstage("Installer", branchName, flags) {
unstash "builtSources"
sh 'make -C ./CI/scripts test_installer'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
}
}
/////////////////////////////////////////////////////
def deployments = [:];
def board = 'ad9208';
def nodeLabel = 'baremetal && high_memory';
deployments[board] = { node(nodeLabel) {
cstage("Baremetal HDL Test", "", flags) {
withEnv(['BOARD='+board,'MLRELEASE=R2023b','HDLBRANCH=hdl_2022_r2','LC_ALL=C.UTF-8','LANG=C.UTF-8']) {
try {
cstage("AD9208 HDL Test", "", flags) {
echo "Node: ${env.NODE_NAME}"
unstash "builtSources"
sh 'make -C ./CI/scripts test'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
finally {
cleanWs();
}
}
}
}}
parallel deployments
/////////////////////////////////////////////////////
boardNames = ['NonHW']
cstage("NonHW Tests", "", flags) {
dockerParallelBuild(boardNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['BOARD='+branchName]) {
cstage("NonHW", branchName, flags) {
unstash "builtSources"
sh 'make -C ./CI/scripts run_NonHWTests'
}
}
}
}
/////////////////////////////////////////////////////
classNames = ['DAQ2']
cstage("Hardware Streaming Tests", "", flags) {
dockerParallelBuild(classNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['HW='+branchName]) {
unstash "builtSources"
sh 'echo ${HW}'
// sh 'make -C ./CI/scripts test_streaming'
}
}
}
//////////////////////////////////////////////////////
node {
cstage('Deploy Development', "", flags) {
unstash "builtSources"
uploadArtifactory('HighSpeedConverterToolbox','*.mltbx')
}
if (env.BRANCH_NAME == 'master') {
cstage('Deploy Production', "", flags) {
unstash "builtSources"
uploadFTP('HighSpeedConverterToolbox','*.mltbx')
}
}
}
//////////////////////////////////////////////////////
// boardNames = ['daq2','ad9081']
// dockerConfig.add("-e HDLBRANCH=hdl_2019_r2")
// stage("HDL Tests") {
// dockerParallelBuild(boardNames, dockerHost, dockerConfig) {
// branchName ->
// withEnv(['BOARD='+branchName]) {
// stage("Synth") {
// unstash "builtSources"
// sh 'make -C ./CI/scripts test_synth'
// junit testResults: 'test/*.xml', allowEmptyResults: true
// archiveArtifacts artifacts: 'test/**/*.log', followSymlinks: false, allowEmptyArchive: true
// }
// }
// }
// }
//