@@ -17,17 +17,17 @@ def localRunPytest(String extra_args="") {
1717getApproval()
1818
1919pipeline {
20- agent {
21- label ' x86_64&&macOS' // These agents have 24 cores so good for parallel xsim runs
22- }
20+ agent none
2321 environment {
2422 REPO = ' lib_src'
2523 VIEW = getViewName(REPO )
2624 PYTHON_VERSION = " 3.10.5"
2725 VENV_DIRNAME = " .venv"
26+ XMOSDOC_VERSION = " v4.0"
2827 }
2928 options {
3029 skipDefaultCheckout()
30+ timestamps()
3131 }
3232 parameters {
3333 string(
@@ -37,119 +37,142 @@ pipeline {
3737 )
3838 }
3939 stages {
40- stage(' Get repo' ) {
41- steps {
42- sh " mkdir ${ REPO} "
43- // source checks require the directory
44- // name to be the same as the repo name
45- dir(" ${ REPO} " ) {
46- // checkout repo
47- checkout scm
48- sh ' git submodule update --init --recursive --depth 1'
49- }
40+ stage(' Build and Test' ) {
41+ when {
42+ expression { ! env. GH_LABEL_DOC_ONLY . toBoolean() }
5043 }
51- }
52- stage (" Create Python environment" )
53- {
54- steps {
55- dir(" ${ REPO} " ) {
56- createVenv(' requirements.txt' )
57- withVenv {
58- sh ' pip install -r requirements.txt'
44+ agent {
45+ label ' x86_64&&docker' // These agents have 24 cores so good for parallel xsim runs
46+ }
47+ stages {
48+ stage(' Get repo' ) {
49+ steps {
50+ sh " mkdir ${ REPO} "
51+ // source checks require the directory
52+ // name to be the same as the repo name
53+ dir(" ${ REPO} " ) {
54+ // checkout repo
55+ checkout scm
56+ sh ' git submodule update --init --recursive --depth 1'
57+ }
5958 }
6059 }
61- }
62- }
63- stage(' Library checks' ) {
64- steps {
65- dir(" ${ REPO} " ) {
66- sh ' git clone git@github.com:xmos/infr_apps.git'
67- sh ' git clone git@github.com:xmos/infr_scripts_py.git'
68- // These are needed for xmake legacy build and also changelog check
69- sh ' git clone git@github.com:xmos/lib_logging.git'
70- sh ' git clone git@github.com:xmos/lib_xassert.git'
71- withVenv {
72- sh ' pip install -e infr_scripts_py'
73- sh ' pip install -e infr_apps'
74- dir(" tests" ) {
75- withEnv([" XMOS_ROOT=.." ]) {
76- localRunPytest(' -s test_lib_checks.py -vv' )
60+ stage (" Create Python environment" ) {
61+ steps {
62+ dir(" ${ REPO} " ) {
63+ createVenv(' requirements.txt' )
64+ withVenv {
65+ sh ' pip install -r requirements.txt'
7766 }
7867 }
7968 }
8069 }
81- }
82- }
83- stage(' Test xmake build' ) {
84- steps {
85- runningOn(env. NODE_NAME )
86- dir(" ${ REPO} " ) {
87- withTools(params. TOOLS_VERSION ) {
88- withVenv {
89- dir(" tests" ) {
90- localRunPytest(' -k "legacy" -vv' )
70+ stage(' Library checks' ) {
71+ steps {
72+ dir(" ${ REPO} " ) {
73+ sh ' git clone git@github.com:xmos/infr_apps.git'
74+ sh ' git clone git@github.com:xmos/infr_scripts_py.git'
75+ // These are needed for xmake legacy build and also changelog check
76+ sh ' git clone git@github.com:xmos/lib_logging.git'
77+ sh ' git clone git@github.com:xmos/lib_xassert.git'
78+ withVenv {
79+ sh ' pip install -e infr_scripts_py'
80+ sh ' pip install -e infr_apps'
81+ dir(" tests" ) {
82+ withEnv([" XMOS_ROOT=.." ]) {
83+ localRunPytest(' -s test_lib_checks.py -vv' )
84+ }
85+ }
9186 }
9287 }
9388 }
9489 }
95- }
96- }
97- stage(' Tests XS2' ) {
98- steps {
99- runningOn(env. NODE_NAME )
100- dir(" ${ REPO} " ) {
101- withTools(params. TOOLS_VERSION ) {
102- withVenv {
103- sh ' mkdir build'
104- dir(" build" ) {
105- sh ' rm -rf'
106- sh ' cmake --toolchain ../xmos_cmake_toolchain/xs2a.cmake ..'
107- sh ' make test_ds3_voice test_us3_voice test_unity_gain_voice -j'
90+ stage(' Test xmake build' ) {
91+ steps {
92+ runningOn(env. NODE_NAME )
93+ dir(" ${ REPO} " ) {
94+ withTools(params. TOOLS_VERSION ) {
95+ withVenv {
96+ dir(" tests" ) {
97+ localRunPytest(' -k "legacy" -vv' )
98+ }
99+ }
108100 }
109- dir(" tests" ) {
110- localRunPytest(' -n auto -k "xs2" -vv' )
101+ }
102+ }
103+ }
104+ stage(' Run doc python' ) {
105+ steps {
106+ runningOn(env. NODE_NAME )
107+ dir(" ${ REPO} " ) {
108+ withTools(params. TOOLS_VERSION ) {
109+ withVenv {
110+ sh " sh doc/build_docs_ci.sh $XMOSDOC_VERSION "
111+ archiveArtifacts artifacts : " doc_build.zip" , allowEmptyArchive : true
112+ }
111113 }
112- dir(" build" ) {
113- sh ' rm -rf' // Cleanup XS2 cmake cache for next stage
114+ }
115+ }
116+ }
117+ stage(' Tests XS2' ) {
118+ steps {
119+ runningOn(env. NODE_NAME )
120+ dir(" ${ REPO} " ) {
121+ withTools(params. TOOLS_VERSION ) {
122+ withVenv {
123+ sh ' mkdir -p build'
124+ dir(" build" ) {
125+ sh ' rm CMakeCache.txt'
126+ sh ' cmake --toolchain ../xmos_cmake_toolchain/xs2a.cmake ..'
127+ sh ' make test_ds3_voice test_us3_voice test_unity_gain_voice -j'
128+ }
129+ dir(" tests" ) {
130+ localRunPytest(' -n auto -k "xs2" -vv' )
131+ }
132+ dir(" build" ) {
133+ sh ' rm CMakeCache.txt' // Cleanup XS2 cmake cache for next stage
134+ }
135+ }
114136 }
115137 }
116138 }
117139 }
118- }
119- }
120- stage(' Tests XS3' ) {
121- steps {
122- runningOn(env. NODE_NAME )
123- dir(" ${ REPO} " ) {
124- withTools(params. TOOLS_VERSION ) {
125- withVenv {
126- dir(" tests" ) {
127- localRunPytest(' -m prepare' ) // Do all pre work like building and generating golden ref where needed
140+ stage(' Tests XS3' ) {
141+ steps {
142+ runningOn(env. NODE_NAME )
143+ dir(" ${ REPO} " ) {
144+ withTools(params. TOOLS_VERSION ) {
145+ withVenv {
146+ dir(" tests" ) {
147+ localRunPytest(' -m prepare' ) // Do all pre work like building and generating golden ref where needed
128148
129- // FF3 HiFi tests for OS3 and DS3
130- localRunPytest(' -m main -n auto -k "hifi_ff3" -vv' )
149+ // FF3 HiFi tests for OS3 and DS3
150+ localRunPytest(' -m main -n auto -k "hifi_ff3" -vv' )
131151
132- // ASRC and SSRC tests across all in/out freqs and deviations (asrc only)
133- localRunPytest(' -m main -n auto -k "mrhf" -vv' )
134- archiveArtifacts artifacts : " mips_report*.csv" , allowEmptyArchive : true
152+ // ASRC and SSRC tests across all in/out freqs and deviations (asrc only)
153+ localRunPytest(' -m main -n auto -k "mrhf" -vv' )
154+ archiveArtifacts artifacts : " mips_report*.csv" , allowEmptyArchive : true
135155
136- // VPU enabled ff3 and rat tests
137- localRunPytest(' -m main -k "vpu" -vv' ) // xdist not working yet so no -n auto
156+ // VPU enabled ff3 and rat tests
157+ localRunPytest(' -m main -k "vpu" -vv' ) // xdist not working yet so no -n auto
138158
139- // Profile the ASRC
140- localRunPytest(' -m main -k "profile_asrc" -vv' )
141- sh ' tree'
142- archiveArtifacts artifacts : " gprof_results/*.png" , allowEmptyArchive : true
159+ // Profile the ASRC
160+ localRunPytest(' -m main -k "profile_asrc" -vv' )
161+ sh ' tree'
162+ archiveArtifacts artifacts : " gprof_results/*.png" , allowEmptyArchive : true
163+ }
164+ }
143165 }
144166 }
145167 }
146168 }
147169 }
170+ post {
171+ cleanup {
172+ xcoreCleanSandbox()
173+ }
174+ }
148175 }
149- }
150- post {
151- cleanup {
152- xcoreCleanSandbox()
153- }
176+
154177 }
155178}
0 commit comments