mirror of
https://github.com/corda/corda.git
synced 2025-04-07 19:34:41 +00:00
[INFRA-351] Jenkinsfile for code check jobs (#6272)
This commit is contained in:
parent
ed9b0ff228
commit
e34930f9a8
69
.ci/dev/pr-code-checks/Jenkinsfile
vendored
Normal file
69
.ci/dev/pr-code-checks/Jenkinsfile
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
@Library('corda-shared-build-pipeline-steps')
|
||||
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
||||
|
||||
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
||||
|
||||
pipeline {
|
||||
agent { label 'k8s' }
|
||||
options {
|
||||
timestamps()
|
||||
timeout(time: 3, unit: 'HOURS')
|
||||
}
|
||||
|
||||
environment {
|
||||
PR_CONTEXT_STRING = "PR Code Checks"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Detekt check') {
|
||||
steps {
|
||||
script {
|
||||
pullRequest.createStatus(
|
||||
status: 'pending',
|
||||
context: "${PR_CONTEXT_STRING}",
|
||||
description: "Running code checks",
|
||||
targetUrl: "${env.BUILD_URL}")
|
||||
}
|
||||
sh "./gradlew --no-daemon clean detekt"
|
||||
}
|
||||
}
|
||||
|
||||
stage('Compilation warnings check') {
|
||||
steps {
|
||||
sh "./gradlew --no-daemon -Pcompilation.warningsAsErrors=true compileAll"
|
||||
}
|
||||
}
|
||||
|
||||
stage('No API change check') {
|
||||
steps {
|
||||
sh "./gradlew --no-daemon generateApi"
|
||||
sh ".ci/check-api-changes.sh"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
pullRequest.createStatus(
|
||||
status: 'success',
|
||||
context: "${PR_CONTEXT_STRING}",
|
||||
description: 'Code checks passed',
|
||||
targetUrl: "${env.BUILD_URL}")
|
||||
}
|
||||
}
|
||||
|
||||
failure {
|
||||
script {
|
||||
pullRequest.createStatus(
|
||||
status: 'failure',
|
||||
context: "${PR_CONTEXT_STRING}",
|
||||
description: 'Code checks failed',
|
||||
targetUrl: "${env.BUILD_URL}")
|
||||
}
|
||||
}
|
||||
cleanup {
|
||||
deleteDir() /* clean up our workspace */
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user