Skip to content

Commit

Permalink
Don't run tests if only docs are changed (#1216)
Browse files Browse the repository at this point in the history
* Update Jenkinsfile

* Simplify notOnlyDocs()

* Update Jenkinsfile
  • Loading branch information
artemnikitin authored Jul 9, 2019
1 parent 11b8614 commit ea836f6
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions build/ci/pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ pipeline {
stage('Run tests in parallel') {
parallel {
stage("Run unit and integration tests") {
when {
expression {
checkout scm
notOnlyDocs()
}
}
agent {
label 'linux'
}
steps {
checkout scm
sh 'make -C build/ci ci-pr'
}
}
Expand All @@ -38,11 +43,16 @@ pipeline {
}
}
stage("Run smoke E2E tests") {
when {
expression {
checkout scm
notOnlyDocs()
}
}
agent {
label 'linux'
}
steps {
checkout scm
sh 'make -C build/ci ci-e2e'
}
}
Expand All @@ -58,3 +68,11 @@ pipeline {
}

}

def notOnlyDocs() {
// grep succeeds if there is at least one line without docs/
return sh (
script: "git diff --name-status HEAD~1 HEAD | grep -v docs/",
returnStatus: true
) == 0
}

0 comments on commit ea836f6

Please sign in to comment.