diff options
author | Ghostkeeper <rubend@tutanota.com> | 2018-10-18 18:27:15 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2018-10-18 18:27:15 +0300 |
commit | 7b140277d6942d1c131bb50c2decb59961ed7b34 (patch) | |
tree | 25b6fc1d769109a12b8ba2e8fc76d05db6e4b32e /Jenkinsfile | |
parent | 4e54f13145746e75f2133617eda7a6b188677cb1 (diff) |
Code style: Brackets on new line
Diffstat (limited to 'Jenkinsfile')
-rw-r--r-- | Jenkinsfile | 64 |
1 files changed, 43 insertions, 21 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 3ca803d338..f9a3a9864a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,11 @@ -parallel_nodes(['linux && cura', 'windows && cura']) { - timeout(time: 2, unit: "HOURS") { +parallel_nodes(['linux && cura', 'windows && cura']) +{ + timeout(time: 2, unit: "HOURS") + { // Prepare building - stage('Prepare') { + stage('Prepare') + { // Ensure we start with a clean build directory. step([$class: 'WsCleanup']) @@ -11,13 +14,17 @@ parallel_nodes(['linux && cura', 'windows && cura']) { } // If any error occurs during building, we want to catch it and continue with the "finale" stage. - catchError { + catchError + { // Building and testing should happen in a subdirectory. - dir('build') { + dir('build') + { // Perform the "build". Since Uranium is Python code, this basically only ensures CMake is setup. - stage('Build') { + stage('Build') + { def branch = env.BRANCH_NAME - if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) { + if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) + { branch = "master" } @@ -27,11 +34,14 @@ parallel_nodes(['linux && cura', 'windows && cura']) { } // Try and run the unit tests. If this stage fails, we consider the build to be "unstable". - stage('Unit Test') { - if (isUnix()) { + stage('Unit Test') + { + if (isUnix()) + { // For Linux to show everything def branch = env.BRANCH_NAME - if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) { + if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) + { branch = "master" } def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}") @@ -42,37 +52,48 @@ parallel_nodes(['linux && cura', 'windows && cura']) { export PYTHONPATH=.:"${uranium_dir}" ${env.CURA_ENVIRONMENT_PATH}/${branch}/bin/pytest -x --verbose --full-trace --capture=no ./tests """ - } catch(e) { + } catch(e) + { currentBuild.result = "UNSTABLE" } } - else { + else + { // For Windows - try { + try + { // This also does code style checks. bat 'ctest -V' - } catch(e) { + } catch(e) + { currentBuild.result = "UNSTABLE" } } } - stage('Code Style') { - if (isUnix()) { - // For Linux to show everything + stage('Code Style') + { + if (isUnix()) + { + // For Linux to show everything. + // CMake also runs this test, but if it fails then the test just shows "failed" without details of what exactly failed. def branch = env.BRANCH_NAME - if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) { + if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) + { branch = "master" } def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}") - try { + try + { sh """ cd .. export PYTHONPATH=.:"${uranium_dir}" ${env.CURA_ENVIRONMENT_PATH}/${branch}/bin/python3 run_mypy.py """ - } catch(e) { + } + catch(e) + { currentBuild.result = "UNSTABLE" } } @@ -81,7 +102,8 @@ parallel_nodes(['linux && cura', 'windows && cura']) { } // Perform any post-build actions like notification and publishing of unit tests. - stage('Finalize') { + stage('Finalize') + { // Publish the test results to Jenkins. junit allowEmptyResults: true, testResults: 'build/junit*.xml' |