forked from analogdevicesinc/HighSpeedConverterToolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
119 lines (100 loc) · 3.46 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
@Library('tfc-lib') _
dockerConfig = getDockerConfig(['MATLAB','Vivado'])
dockerConfig.add("-e MLRELEASE=R2020b")
dockerHost = 'docker'
////////////////////////////
hdlBranches = ['master','hdl_2018_r2','hdl_2019_r1']
stage("Build Toolbox") {
dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) {
branchName ->
try {
withEnv(['HDLBRANCH='+branchName]) {
checkout scm
sh 'git submodule update --init'
sh 'make -C ./CI/scripts build'
sh 'make -C ./CI/scripts gen_tlbx'
}
} catch(Exception ex) {
if (branchName == 'hdl_2018_r2') {
error('Production Toolbox Build Failed')
}
else {
unstable('Development Build Failed')
}
}
if (branchName == 'hdl_2018_r2') {
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
}
}
}
/////////////////////////////////////////////////////
boardNames = ['daq2']
dockerConfig.add("-e HDLBRANCH=hdl_2018_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("Installer") {
unstash "builtSources"
sh 'make -C ./CI/scripts test_installer'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
}
}
/////////////////////////////////////////////////////
boardNames = ['daq2', 'NonHW']
dockerConfig.add("-e HDLBRANCH=hdl_2018_r2")
stage("Demo Tests") {
dockerParallelBuild(boardNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['BOARD='+branchName]) {
if (branchName == 'daq2') {
stage("Source") {
unstash "builtSources"
sh 'make -C ./CI/scripts test_targeting_demos'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
else {
stage("NonHW") {
unstash "builtSources"
sh 'make -C ./CI/scripts run_NonHWTests'
}
}
}
}
}
/////////////////////////////////////////////////////
classNames = ['DAQ2']
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('HighSpeedConverterToolbox','*.mltbx')
}
if (env.BRANCH_NAME == 'master') {
stage('Deploy Production') {
unstash "builtSources"
uploadFTP('HighSpeedConverterToolbox','*.mltbx')
}
}
}