Jenkinsfile 1.8 KB

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