Jenkinsfile: add timeout to build and test steps

This will hopefully make CI runs more robust and recover stale workers.
This commit is contained in:
Martin Weinelt 2020-04-26 02:24:43 +02:00
parent 5231fb0178
commit dd7d37b8e4

View File

@ -37,7 +37,9 @@ pipeline {
sh label: 'Identify runner', script: 'echo $SLAVE_NAME' sh label: 'Identify runner', script: 'echo $SLAVE_NAME'
sh 'make update' sh 'make update'
sh 'test -d /dl_cache && ln -s /dl_cache openwrt/dl || true' sh 'test -d /dl_cache && ln -s /dl_cache openwrt/dl || true'
timeout(time: 2, unit: "HOURS") {
sh 'make -j$(nproc) V=s' sh 'make -j$(nproc) V=s'
}
stash includes: '**/output/images/factory/*-x86-64.img.gz', name: 'gluon-x86-64-factory' stash includes: '**/output/images/factory/*-x86-64.img.gz', name: 'gluon-x86-64-factory'
} }
} }
@ -53,12 +55,14 @@ pipeline {
sh label: 'Print python environment', script: 'python3 -m pip freeze' sh label: 'Print python environment', script: 'python3 -m pip freeze'
script { script {
for (f in findFiles(glob: 'tests/*.py')) { for (f in findFiles(glob: 'tests/*.py')) {
timeout(time: 10, unit: "MINUTES") {
sh label: "Test ${f.name}", script: "python3 tests/${f.name} --use-tmp-workdir" sh label: "Test ${f.name}", script: "python3 tests/${f.name} --use-tmp-workdir"
} }
} }
} }
} }
} }
}
} }
/* /*