-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
102 lines (96 loc) · 2.03 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
@Library('[email protected]') _
def run_tests(cmake_ver) {
createVenv('python_version.txt')
withVenv {
sh 'pip install -r requirements.txt'
script {
if ("${cmake_ver}" == 'latest') {
sh 'pip install cmake'
}
else {
sh "pip install cmake==${cmake_ver}"
}
}
dir('tests') {
withTools(params.TOOLS_VERSION) {
withEnv(["XMOS_CMAKE_PATH=${WORKSPACE}"]) {
sh 'pytest -n auto --junitxml=pytest_result.xml'
}
}
}
}
}
def os_label = [
linux: 'linux && x86_64',
macos: 'macos && arm64',
windows: 'windows && x86_64',
]
getApproval()
pipeline {
agent none
options {
timestamps()
buildDiscarder(xmosDiscardBuildSettings(onlyArtifacts=false))
}
parameters {
string(
name: 'TOOLS_VERSION',
defaultValue: '15.3.0',
description: 'The XTC Tools version'
)
string(
name: 'XMOSDOC_VERSION',
defaultValue: 'v6.2.0',
description: 'The xmosdoc version'
)
}
stages {
stage('Documentation') {
agent {
label 'linux && x86_64'
}
steps {
println "Stage running on ${env.NODE_NAME}"
buildDocs()
}
post {
cleanup {
xcoreCleanSandbox()
}
}
}
stage('Test') {
matrix {
axes {
axis {
name 'PLATFORM'
values 'linux', 'macos', 'windows'
}
axis {
name 'CMAKE_VERSION'
values '3.21.0', 'latest'
}
}
stages {
stage("Test") {
agent {
label "${os_label[env.PLATFORM]}"
}
steps {
println "Stage running on ${env.NODE_NAME}"
run_tests("${CMAKE_VERSION}")
}
post {
always {
junit 'tests/pytest_result.xml'
}
cleanup {
xcoreCleanSandbox()
}
}
}
}
}
}
}
}