forked from xmos/lib_nn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
84 lines (79 loc) · 2.96 KB
/
Copy pathJenkinsfile
File metadata and controls
84 lines (79 loc) · 2.96 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
@Library('xmos_jenkins_shared_library@v0.14.2') _
getApproval()
pipeline {
agent {
dockerfile {
args "-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v /home/jenkins/.ssh:/home/jenkins/.ssh:ro"
}
}
parameters { // Available to modify on the job page within Jenkins if starting a build
string( // use to try different tools versions
name: 'TOOLS_VERSION',
defaultValue: '15.0.1',
description: 'The tools version to build with (check /projects/tools/ReleasesTools/)'
)
}
options { // plenty of things could go here
//buildDiscarder(logRotator(numToKeepStr: '10'))
timestamps()
}
stages {
stage("Setup") {
// Clone and install build dependencies
steps {
// clean auto default checkout
sh "rm -rf *"
// clone
checkout([
$class: 'GitSCM',
branches: scm.branches,
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'SubmoduleOption',
threads: 8,
timeout: 20,
shallow: true,
parentCredentials: true,
recursiveSubmodules: true],
[$class: 'CleanCheckout']],
userRemoteConfigs: [[credentialsId: 'xmos-bot',
url: 'git@github.com:xmos/lib_nn']]
])
// fetch dependencies
sshagent (credentials: ['xmos-bot']) {
dir("${env.WORKSPACE}/test") {
sh "python fetch_dependencies.py"
}
}
// create venv
sh "conda env create -q -p lib_nn_venv -f environment.yml"
// install xmos tools version
sh "/XMOS/get_tools.py " + params.TOOLS_VERSION
}
}
stage("Update all packages") {
// Roll all conda packages forward beyond their pinned versions
when { expression { return params.UPDATE_ALL } }
steps {
sh "conda update --all -y -q -p lib_nn_venv"
}
}
stage("Build") {
steps {
// below is how we can activate the tools
sh """pushd /XMOS/tools/${params.TOOLS_VERSION}/XMOS/xTIMEcomposer/${params.TOOLS_VERSION} && . SetEnv && popd &&
. activate ./lib_nn_venv &&
cd test/unit_test && make all && make all PLATFORM=x86 MEMORY_SAFE=true"""
}
}
stage("Test") {
steps {
sh """cd test/unit_test && ./bin/x86/unit_test"""
}
}
}
post {
cleanup {
cleanWs()
}
}
}