From 88aa3087fe6a3b3b703d635174ae31f3286a8790 Mon Sep 17 00:00:00 2001 From: Erki Date: Sun, 23 Jan 2022 18:33:24 +0200 Subject: [PATCH 1/5] Yup, away we goo --- Jenkinsfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..2d8eda2 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,22 @@ +pipeline { + agent { + label { + "ubuntu" + } + } + + stages { + stage("build && test") { + steps { + sh 'sudo pip3 install --upgrade conan==1.42.1' + sh 'conan profile new default --detect' + sh 'conan profile update settings.compiler.libcxx=libstdc++11 default' + sh 'mkdir -p build && cd build' + sh 'conan install .. --build=missing' + sh 'cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=ON' + sh 'ninja' + sh 'ctest . --output-on-failure' + } + } + } +} From dc9e159377dc52d5a7677706bd36cf796a13ae93 Mon Sep 17 00:00:00 2001 From: Erki Date: Sun, 23 Jan 2022 18:34:37 +0200 Subject: [PATCH 2/5] le woops --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2d8eda2..d8b2b39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,6 @@ pipeline { agent { - label { - "ubuntu" - } + label 'ubuntu' } stages { From d909651bf1c84696869bbc3460551f9e6d54d5ad Mon Sep 17 00:00:00 2001 From: Erki Date: Sun, 23 Jan 2022 18:46:26 +0200 Subject: [PATCH 3/5] testies --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index d8b2b39..f24db61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,8 @@ pipeline { stages { stage("build && test") { steps { + echo 'Workspace: ${env.WORKSPACE}' + sh 'ls' sh 'sudo pip3 install --upgrade conan==1.42.1' sh 'conan profile new default --detect' sh 'conan profile update settings.compiler.libcxx=libstdc++11 default' From b8c3e32fd63370cd15b646a3d0ccb20f3dab2321 Mon Sep 17 00:00:00 2001 From: Erki Date: Sun, 23 Jan 2022 18:48:39 +0200 Subject: [PATCH 4/5] yup --- Jenkinsfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f24db61..9792dc8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,16 +6,20 @@ pipeline { stages { stage("build && test") { steps { - echo 'Workspace: ${env.WORKSPACE}' + echo "Workspace: ${env.WORKSPACE}" sh 'ls' sh 'sudo pip3 install --upgrade conan==1.42.1' sh 'conan profile new default --detect' sh 'conan profile update settings.compiler.libcxx=libstdc++11 default' - sh 'mkdir -p build && cd build' - sh 'conan install .. --build=missing' - sh 'cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=ON' - sh 'ninja' - sh 'ctest . --output-on-failure' + sh 'mkdir -p build' + + dir("build") { + sh 'ls' + sh 'conan install .. --build=missing' + sh 'cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=ON' + sh 'ninja' + sh 'ctest . --output-on-failure' + } } } } From 227af3c9fcd3b00b8ac2f432591ef908deb8ab1b Mon Sep 17 00:00:00 2001 From: Erki Date: Sun, 23 Jan 2022 19:12:47 +0200 Subject: [PATCH 5/5] now with XML --- Jenkinsfile | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9792dc8..4a79b6c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,9 +18,38 @@ pipeline { sh 'conan install .. --build=missing' sh 'cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=ON' sh 'ninja' - sh 'ctest . --output-on-failure' + sh 'ctest . -T test --output-on-failure --no-compress-output' } } } } + + post { + always { + archiveArtifacts ( + artifacts: 'build/Testing/**/*.xml', + fingerprint: true + ) + + // Process the CTest xml output with the xUnit plugin + xunit ( + testTimeMargin: '3000', + thresholdMode: 1, + thresholds: [ + skipped(failureThreshold: '0'), + failed(failureThreshold: '0') + ], + tools: [CTest( + pattern: 'build/Testing/**/*.xml', + deleteOutputFiles: true, + failIfNotNew: false, + skipNoTestFiles: true, + stopProcessingIfError: true + )] + ) + + // Clear the source and build dirs before next run + deleteDir() + } + } }