diff --git a/.gitmodules b/.gitmodules index d0c20f3..4937171 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,12 @@ [submodule "third-party/pybind11"] path = third-party/pybind11 url = https://github.com/pybind/pybind11.git [submodule "third-party/googletest"] path = third-party/googletest url = https://github.com/google/googletest.git [submodule "third-party/expolit"] path = third-party/expolit - url = ssh://git@c4science.ch/source/expolit.git + url = https://c4science.ch/source/expolit.git [submodule "tests/ci/scripts"] path = tests/ci/scripts - url = ssh://git@c4science.ch/diffusion/HBMJCI/hbm-jenkins-ci.git + url = https://c4science.ch/diffusion/HBMJCI/hbm-jenkins-ci.git diff --git a/Jenkinsfile b/Jenkinsfile index ed016da..dc5cde5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,113 +1,112 @@ pipeline { parameters {string(defaultValue: '', description: 'api-token', name: 'API_TOKEN') string(defaultValue: '', description: 'buildable phid', name: 'BUILD_TARGET_PHID') string(defaultValue: '', description: 'Commit id', name: 'COMMIT_ID') string(defaultValue: '', description: 'Diff id', name: 'DIFF_ID') string(defaultValue: 'PHID-PROJ-gbo56hpf2y5bi7t5jusk', description: 'ID of the project', name: 'PROJECT_ID') } environment { PHABRICATOR_HOST = 'https://c4science.ch/api/' PYTHONPATH = sh returnStdout: true, script: 'echo ${WORKSPACE}/tests/ci/script/' } agent { dockerfile { additionalBuildArgs '--tag tamaas-environment'} } stages { stage('SCM Checkout') { steps { checkout scm: [$class: 'GitSCM', branches: [[name: '${COMMIT_ID}']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', disableSubmodules: false, - parentCredentials: true, + parentCredentials: false, recursiveSubmodules: true, reference: '', trackingSubmodules: true]], - submoduleCfg: [], - userRemoteConfigs: [[]]], changelog: true + submoduleCfg: []], changelog: true } } stage('Configure') { steps { sh '''#!/usr/bin/env bash echo "py_exec = \'python3\'" > build-setup.conf echo "build_python = \'true\'" >> build-setup.conf echo "build_tests = \'true\'" >> build-setup.conf echo "use_googletest = \'true\'" >> build-setup.conf ''' } } stage('Compile') { steps { sh '''#!/usr/bin/env bash set -o pipefail rm -rf .sconf_temp scons | tee compilation.txt ''' } post { failure { uploadArtifact('compilation.txt', 'Compilation') } } } stage('Run tests') { steps { sh 'PYTHONPATH=build-release/python/ python3 -m pytest --junitxml=results.xml build-release' } } } post { always { createArtifact("results.xml") junit 'results.xml' step([$class: 'XUnitBuilder', thresholds: [ [$class: 'SkippedThreshold', failureThreshold: '0'], [$class: 'FailedThreshold', failureThreshold: '0']], tools: [[$class: 'GoogleTestType', pattern: 'build-release/tests/gtest_results.xml']]]) } success { passed_hbm() } failure { failed_hbm() emailext( body: '''${SCRIPT, template="groovy-html.template"}''', mimeType: 'text/html', subject: "[Jenkins] ${currentBuild.fullDisplayName} Failed", recipientProviders: [[$class: 'CulpritsRecipientProvider']], to: 'lucas.frerot@epfl.ch', attachLog: true, compressLog: true) } } } def createArtifact(filename) { sh "./tests/ci/scripts/hbm send-uri -k 'Jenkins URI' -u ${BUILD_URL} -l 'View Jenkins result'" sh "./tests/ci/scripts/hbm send-junit-results -f ${filename}" } def uploadArtifact(artifact, name) { sh "./test/ci/scripts/hbm upload-file -f ${artifact} -n \"${name}\" -v ${PROJECT_ID}" } def failed_hbm() { sh "./tests/ci/scripts/hbm failed" } def passed_hbm() { sh "./tests/ci/scripts/hbm passed" } \ No newline at end of file