forked from xmos/lib_mic_array
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
147 lines (147 loc) · 5.67 KB
/
Copy pathJenkinsfile
File metadata and controls
147 lines (147 loc) · 5.67 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@Library('xmos_jenkins_shared_library@v0.25.0') _
getApproval()
pipeline {
agent none
options {
disableConcurrentBuilds()
skipDefaultCheckout()
timestamps()
// on develop discard builds after a certain number else keep forever
buildDiscarder(logRotator(
numToKeepStr: env.BRANCH_NAME ==~ /develop/ ? '25' : '',
artifactNumToKeepStr: env.BRANCH_NAME ==~ /develop/ ? '25' : ''
))
}
parameters {
string(
name: 'TOOLS_VERSION',
defaultValue: '15.2.1',
description: 'The XTC tools version'
)
}
environment {
REPO = 'lib_mic_array'
}
stages {
stage('Build and Docs') {
parallel {
stage('Build Docs') {
agent { label "docker" }
environment { XMOSDOC_VERSION = "v4.0" }
steps {
checkout scm
sh 'git submodule update --init --recursive --depth 1'
sh "docker pull ghcr.io/xmos/xmosdoc:$XMOSDOC_VERSION"
sh """docker run -u "\$(id -u):\$(id -g)" \
--rm \
-v ${WORKSPACE}:/build \
ghcr.io/xmos/xmosdoc:$XMOSDOC_VERSION -v"""
archiveArtifacts artifacts: "doc/_build/**", allowEmptyArchive: true
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Basic tests') {
when {
expression { !env.GH_LABEL_DOC_ONLY.toBoolean() }
}
agent {
label 'x86_64 && linux'
}
stages {
stage("Setup") {
// Clone and install build dependencies
steps {
// Print the build agent name
println "RUNNING ON"
println env.NODE_NAME
// Clone infrastructure repos
sh "git clone --branch v1.4.6 git@github.com:xmos/infr_apps"
sh "git clone --branch v1.2.1 git@github.com:xmos/infr_scripts_py"
// clone
dir("$REPO") {
checkout scm
sh "git submodule update --init --recursive"
withTools(params.TOOLS_VERSION) {
installDependencies()
}
}
}
}
stage("Lib checks") {
steps {
println "Unlikely these will pass.."
// warnError("Source Check"){ sourceCheck("${REPO}") }
// warnError("Changelog Check"){ xcoreChangelogCheck("${REPO}") }
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
}
}
stage('HW tests') {
when {
expression { !env.GH_LABEL_DOC_ONLY.toBoolean() }
}
agent {
label 'xvf3800' // We have plenty of these (6) and they have a single XTAG connected
}
stages {
stage("Setup") {
// Clone and install build dependencies
steps {
// clone
dir("$REPO") {
println "RUNNING ON"
println env.NODE_NAME
checkout scm
sh "git submodule update --init --recursive"
withTools(params.TOOLS_VERSION) {
installDependencies()
}
}
}
}
stage("Build firmware") {
steps {
withTools(params.TOOLS_VERSION) {
dir("$REPO"){
sh ". .github/scripts/build_test_apps.sh"
}
}
}
}
stage('Run tests') {
steps {
dir("${REPO}") {
withTools(params.TOOLS_VERSION) {
withVenv {
// Use xtagctl to reset the relevent adapters first, if attached, to be safe.
// sh "xtagctl reset_all XVF3800_INT XVF3600_USB"
sh ". .github/scripts/run_test_apps.sh"
}
}
}
dir("${REPO}/..") {
// archiveArtifacts artifacts: "src/BeClearMemory.S", fingerprint: true
}
}
}
}
post {
cleanup {
xcoreCleanSandbox()
cleanWs()
}
}
}
}
}