2024-08-20 07:38:38 +00:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
library 'status-jenkins-lib@v1.9.6'
|
2024-07-04 10:50:15 +00:00
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent { label 'linux && x86_64 && nix-2.19' }
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
string(
|
|
|
|
name: 'BRANCH',
|
|
|
|
defaultValue: 'develop',
|
|
|
|
description: 'Name of branch to build.'
|
|
|
|
)
|
2024-09-24 15:33:26 +00:00
|
|
|
booleanParam(
|
2024-10-03 13:51:51 +00:00
|
|
|
name: 'FUNCTIONAL_TESTS_REPORT_CODECOV',
|
2024-09-24 15:33:26 +00:00
|
|
|
defaultValue: true,
|
|
|
|
description: 'Should the job report test coverage to Codecov?'
|
|
|
|
)
|
2024-07-04 10:50:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 30, unit: 'MINUTES')
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '5',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
artifactNumToKeepStr: '1',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
PLATFORM = 'tests-rpc'
|
|
|
|
PKG_URL = "${currentBuild.absoluteUrl}/consoleText"
|
2024-09-24 15:33:26 +00:00
|
|
|
|
|
|
|
/* Hack-fix for params not being set in env on first job run. */
|
|
|
|
BRANCH = "${params.BRANCH}"
|
2024-10-03 13:51:51 +00:00
|
|
|
FUNCTIONAL_TESTS_REPORT_CODECOV = "${params.FUNCTIONAL_TESTS_REPORT_CODECOV}"
|
2024-07-04 10:50:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('RPC Tests') {
|
|
|
|
steps { script {
|
2024-09-24 15:33:26 +00:00
|
|
|
withCredentials([
|
|
|
|
string(
|
|
|
|
credentialsId: 'codecov-repository-upload-token',
|
|
|
|
variable: 'CODECOV_TOKEN'
|
|
|
|
),
|
|
|
|
]) {
|
2024-10-03 13:51:51 +00:00
|
|
|
nix.shell('make test-functional', pure: false)
|
2024-09-24 15:33:26 +00:00
|
|
|
}
|
2024-07-04 10:50:15 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
} // stages
|
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
script {
|
2024-08-20 07:38:38 +00:00
|
|
|
archiveArtifacts(
|
2024-10-03 13:51:51 +00:00
|
|
|
artifacts: 'tests-functional/reports/*.xml, tests-functional/*.log, tests-functional/coverage/coverage.html',
|
2024-08-20 07:38:38 +00:00
|
|
|
allowEmptyArchive: true,
|
|
|
|
)
|
2024-07-04 10:50:15 +00:00
|
|
|
junit(
|
2024-10-03 13:51:51 +00:00
|
|
|
testResults: 'tests-functional/reports/*.xml',
|
2024-07-04 10:50:15 +00:00
|
|
|
skipOldReports: true,
|
|
|
|
skipPublishingChecks: true,
|
2024-08-20 07:38:38 +00:00
|
|
|
skipMarkingBuildUnstable: true,
|
2024-07-04 10:50:15 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
2024-08-20 07:38:38 +00:00
|
|
|
cleanup { sh 'make git-clean' }
|
2024-07-04 10:50:15 +00:00
|
|
|
} // post
|
|
|
|
} // pipeline
|