Code style: Brackets on new line

This commit is contained in:
Ghostkeeper 2018-10-18 17:27:15 +02:00
parent 4e54f13145
commit 7b140277d6
No known key found for this signature in database
GPG Key ID: 86BEF881AE2CF276

64
Jenkinsfile vendored
View File

@ -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'