From 115e708fbc1ef4a1395f1e5152446f0046f50da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Tue, 3 Dec 2019 15:02:38 +0100 Subject: [PATCH] Jenkins: delete the workspace after a build --- Jenkinsfile | 60 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f8da394af..4edff3a37 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,26 +1,44 @@ def runStages() { - stage("Clone") { - /* The Git repo seems to be cached in some Jenkins plugin, so this is not always a clean clone. */ - checkout scm - sh "make build-system-checks || true" - } - stage("Build") { - sh "make -j${env.NPROC} update" /* to allow a newer Nim version to be detected */ - sh "make -j${env.NPROC} V=1 deps" /* to allow the following parallel stages */ - } - stage("Test") { - parallel( - "tools": { - stage("Tools") { - sh "make -j${env.NPROC}" - } - }, - "test suite": { - stage("Test suite") { - sh "make -j${env.NPROC} test" - } + try { + stage("Clone") { + // The Git repo seems to be cached in some Jenkins plugin, so this is not always a clean clone. + checkout scm + sh "make build-system-checks || true" + } + + // caching doesn't work; extension probably not configured + + //cache(maxCacheSize: 250, caches: [ + //[$class: "ArbitraryFileCache", excludes: "", includes: "**/*", path: "${WORKSPACE}/vendor/nimbus-build-system/vendor/Nim/bin"], + //[$class: "ArbitraryFileCache", excludes: "", includes: "**/*", path: "${WORKSPACE}/vendor/go/bin"], + //[$class: "ArbitraryFileCache", excludes: "", includes: "**/*", path: "${WORKSPACE}/jsonTestsCache"] + //]) { + stage("Build") { + sh "make -j${env.NPROC} update" /* to allow a newer Nim version to be detected */ + sh "make -j${env.NPROC} deps" /* to allow the following parallel stages */ + sh "scripts/setup_official_tests.sh jsonTestsCache" } - ) + //} + + stage("Test") { + parallel( + "tools": { + stage("Tools") { + sh "make -j${env.NPROC}" + } + }, + "test suite": { + stage("Test suite") { + sh "make -j${env.NPROC} DISABLE_TEST_FIXTURES_SCRIPT=1 test" + } + } + ) + } + } catch(e) { + echo "'${env.STAGE_NAME}' stage failed" + throw e + } finally { + cleanWs() } }