mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-05 12:25:19 +00:00
build: Consolidate touched file checks
This will make it easier to add more in the future. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
2f855c9a67
commit
0031dacd7b
39
Jenkinsfile
vendored
39
Jenkinsfile
vendored
@ -10,29 +10,16 @@ pipeline {
|
|||||||
checkout scm
|
checkout scm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Check for documentation only changes') {
|
stage('Check if worker build can be skipped') {
|
||||||
when {
|
when {
|
||||||
expression {
|
expression {
|
||||||
return docsFileOnly()
|
return skipWorkerBuild()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
runWorkers = false
|
runWorkers = false
|
||||||
echo 'Documentation only changes, no need to run the CI'
|
echo 'No changes requring a build'
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Check for fuzzer files only changes') {
|
|
||||||
when {
|
|
||||||
expression {
|
|
||||||
return fuzzFileOnly()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
runWorkers = false
|
|
||||||
echo 'Fuzzer cargo files only changes, no need to run the CI'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,24 +419,24 @@ def installAzureCli(distro, arch) {
|
|||||||
sh 'sudo apt install -y azure-cli'
|
sh 'sudo apt install -y azure-cli'
|
||||||
}
|
}
|
||||||
|
|
||||||
def boolean docsFileOnly() {
|
def boolean skipWorkerBuild() {
|
||||||
if (env.CHANGE_TARGET == null) {
|
if (env.CHANGE_TARGET == null) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return sh(
|
if (sh(
|
||||||
returnStatus: true,
|
returnStatus: true,
|
||||||
script: "git diff --name-only origin/${env.CHANGE_TARGET}... | grep -v '\\.md'"
|
script: "git diff --name-only origin/${env.CHANGE_TARGET}... | grep -v '\\.md'"
|
||||||
) != 0
|
) != 0) {
|
||||||
}
|
return true
|
||||||
|
|
||||||
def boolean fuzzFileOnly() {
|
|
||||||
if (env.CHANGE_TARGET == null) {
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return sh(
|
if (sh(
|
||||||
returnStatus: true,
|
returnStatus: true,
|
||||||
script: "git diff --name-only origin/${env.CHANGE_TARGET}... | grep -v -E 'fuzz/'"
|
script: "git diff --name-only origin/${env.CHANGE_TARGET}... | grep -v -E 'fuzz/'"
|
||||||
) != 0
|
) != 0) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user