-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJenkinsfile
More file actions
129 lines (101 loc) · 2.61 KB
/
Jenkinsfile
File metadata and controls
129 lines (101 loc) · 2.61 KB
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
pipeline {
agent any
stages {
stage('Build') {
agent {
docker {
args '--network host'
image 'build-bare-metal-env:latest'
}
}
steps {
sh '''# Build Test runner
# Source setup code
. /arm-tools/init.sh
# Build test runner
(cd ./bare-metal && make tests)
# Verify existence of test runner code
cat ./bare-metal/tests/runners/test_mycode_runner.c'''
sh '''# Build Test App
# Source setup code
. /arm-tools/init.sh
# Build Test axf
(cd ./bare-metal && make build_test)
# Verify existence of test axf
cat ./bare-metal/IOTKit_ARMv8MBL_test.axf'''
sh '''# Build Production App
# Source setup code
. /arm-tools/init.sh
# Build Production axf
(cd ./bare-metal && make build_prod)
# Verify existence of test axf
cat ./bare-metal/IOTKit_ARMv8MBL.axf'''
archiveArtifacts 'bare-metal/IOTKit_ARMv8MBL_test.axf'
stash(name: 'bare-metal-app', includes: 'bare-metal/IOTKit_ARMv8MBL_test.axf')
}
}
stage('Test') {
parallel {
stage('bare-metal') {
agent {
docker {
image 'test-bare-metal-env:latest'
args '--network host'
}
}
post {
always {
junit '**/result.xml'
}
}
steps {
unstash 'bare-metal-app'
sh '''# make results directory
mkdir outputs/'''
sh '''# Run tests
# Source setup code
. /arm-tools/init.sh
# Kill all other running instances
pkill FVP_MPS2_Cortex
#/arm-tools/Cortex-M33-FVP/FVP_MPS2_Cortex-M33 -C fvp_mps2.DISABLE_GATING=1 -C fvp_mps2.platform_type=1 --cadi-server &sleep 2s
# Run test
python bare-metal/model_run.py localhost 7000 bare-metal/IOTKit_ARMv8MBL_test.axf outputs/output.test
# Verify test output exists
cat outputs/output.test'''
sh '''# Convert to junit output
python /home/unity_to_junit.py outputs/
# verify result.xml exists
cat result.xml
'''
}
}
stage('linux') {
agent {
docker {
image 'test-linux-env:latest'
}
}
post {
always {
junit '**/result.xml'
}
}
steps {
sh '''# make results directory
mkdir outputs/'''
sh '''# Run test
ls linux/
ls linux/test/
ls linux/src
python -m pytest --junitxml=outputs/output.test linux/test/test.py
# Verify test output exists
cat outputs/output.test'''
sh '''# Rename test output for Jenkins to find it
cp outputs/output.test result.xml
'''
}
}
}
}
}
}