From 5b5feb51f52548b2c2c390829ec2dcee5d463337 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 22 Dec 2023 21:43:12 +0100 Subject: [PATCH] adds Jenkinsfile --- .cproject | 40 ++++++++++++++++++++--------- Jenkinsfile | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 12 deletions(-) create mode 100644 Jenkinsfile diff --git a/.cproject b/.cproject index bf2d74a..301b355 100644 --- a/.cproject +++ b/.cproject @@ -123,18 +123,6 @@ - - - - make - $<cmake4eclipse_dyn> - test - true - true - true - - - @@ -155,4 +143,32 @@ + + + + make + $<cmake4eclipse_dyn> + test + true + true + true + + + make + $<cmake4eclipse_dyn> + format + true + true + true + + + make + $<cmake4eclipse_dyn> + format-check + true + true + true + + + \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..34c3dbc --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,74 @@ +pipeline { + agent any + options { + // using the Timestamper plugin we can add timestamps to the console log + timestamps() + skipStagesAfterUnstable() + } + stages { + stage('SCC test pipeline') { + agent {docker { + image 'ubuntu-riscv' + } } + stages { + stage('checkout') { + steps { + sh 'env' + sh 'rm -rf * .??* ' + checkout([ + $class: 'GitSCM', + branches: [ + [name: 'refs/heads/' + getBranch()] + ], + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'SubmoduleOption', + disableSubmodules: false, + recursiveSubmodules: true, + trackingSubmodules: false, + parentCredentials: true, + shallow: true + ] + ], + submoduleCfg: [], + userRemoteConfigs: [ + [credentialsId: 'gitea-jenkins', url: 'https://git.minres.com/SystemC/SystemC-Components-Test.git'] + ] + ]) + sh ''' + pip3 install "conan<2.0" pyucis + conan profile new default --detect --force + conan remote list | grep minres > /dev/null + [ $? ] || conan remote add minres https://git.minres.com/api/packages/Tooling/conan + ''' + } + } + stage('build & test') { + steps { + sh ''' + cmake -S . -B build + cmake --build build -j12 + cmake --build build --target test + cmake --build build --target format-check + ''' + } + } + } + } + } + + post { + success { + rocketSend ":thumbsup: SCC test run passed, results at ${env.RUN_DISPLAY_URL} " + } + failure { + rocketSend ":thumbsdown: SCC test failed, please check ${env.RUN_DISPLAY_URL} " + emailext recipientProviders: [culprits(), requestor()], + subject: "SCC Test Pipeline Failed: ${currentBuild.fullDisplayName}", + body: """ +

Build Status: ${currentBuild.currentResult}

+

Check logs at Build Console Logs or at Overview

+ """ + } + } +}