Jenkinsfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. parallel_nodes(['linux && cura', 'windows && cura']) {
  2. timeout(time: 2, unit: "HOURS") {
  3. // Prepare building
  4. stage('Prepare') {
  5. // Ensure we start with a clean build directory.
  6. step([$class: 'WsCleanup'])
  7. // Checkout whatever sources are linked to this pipeline.
  8. checkout scm
  9. }
  10. // If any error occurs during building, we want to catch it and continue with the "finale" stage.
  11. catchError {
  12. // Building and testing should happen in a subdirectory.
  13. dir('build') {
  14. // Perform the "build". Since Uranium is Python code, this basically only ensures CMake is setup.
  15. stage('Build') {
  16. def branch = env.BRANCH_NAME
  17. if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) {
  18. branch = "master"
  19. }
  20. // Ensure CMake is setup. Note that since this is Python code we do not really "build" it.
  21. def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}")
  22. cmake("..", "-DCMAKE_PREFIX_PATH=\"${env.CURA_ENVIRONMENT_PATH}/${branch}\" -DCMAKE_BUILD_TYPE=Release -DURANIUM_DIR=\"${uranium_dir}\"")
  23. }
  24. // Try and run the unit tests. If this stage fails, we consider the build to be "unstable".
  25. stage('Unit Test') {
  26. try {
  27. make('test')
  28. } catch(e) {
  29. currentBuild.result = "UNSTABLE"
  30. }
  31. }
  32. }
  33. }
  34. // Perform any post-build actions like notification and publishing of unit tests.
  35. stage('Finalize') {
  36. // Publish the test results to Jenkins.
  37. junit allowEmptyResults: true, testResults: 'build/junit*.xml'
  38. notify_build_result(env.CURA_EMAIL_RECIPIENTS, '#cura-dev', ['master', '2.'])
  39. }
  40. }
  41. }