-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathJenkinsfile
More file actions
97 lines (92 loc) · 2.7 KB
/
Jenkinsfile
File metadata and controls
97 lines (92 loc) · 2.7 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
@Library('xmos_jenkins_shared_library@v0.27.0') _
def localRunPytest(String extra_args="") {
catchError{
sh "python -m pytest --junitxml=pytest_result.xml -rA -v --durations=0 -o junit_logging=all ${extra_args}"
}
junit "pytest_result.xml"
}
getApproval()
pipeline {
agent {
label 'linux&&64'
}
options {
disableConcurrentBuilds()
skipDefaultCheckout()
timestamps()
buildDiscarder(xmosDiscardBuildSettings())
}
parameters {
string(
name: 'TOOLS_VERSION',
defaultValue: '15.2.1',
description: 'The XTC tools version'
)
}
environment {
REPO = 'xmos_cmake_toolchain'
PYTHON_VERSION = "3.10.5"
VENV_DIRNAME = ".venv"
}
stages {
stage('Get repo') {
steps {
sh "mkdir ${REPO}"
// source checks require the directory
// name to be the same as the repo name
dir("${REPO}") {
checkout scm
sh 'git submodule update --init --recursive --depth 1'
}
}
}
stage ("Create Python environment") {
steps {
dir("${REPO}") {
createVenv('requirements.txt')
withVenv {
sh 'pip install -r requirements.txt'
}
}
}
}
stage('Library checks') {
steps {
dir("${REPO}") {
sh 'git clone git@github.com:xmos/infr_apps.git'
sh 'git clone git@github.com:xmos/infr_scripts_py.git'
withVenv {
sh 'pip install -e infr_scripts_py'
sh 'pip install -e infr_apps'
dir("test") {
withEnv(["XMOS_ROOT=.."]) {
localRunPytest('-s test_lib_checks.py -vv')
}
}
}
}
}
}
stage('Tests') {
steps {
dir("${REPO}") {
withVenv {
withTools(params.TOOLS_VERSION) {
dir("test") {
withEnv(["XMOS_ROOT=.."]) {
sh 'tox run'
junit "pytest_result.xml"
}
}
}
}
}
}
}
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}