From 3a18860326cb5d2477c7eba0b1561f0ee98642ee Mon Sep 17 00:00:00 2001 From: Jinank Jain Date: Mon, 6 Jun 2022 14:50:33 +0000 Subject: [PATCH] Reapply "Jenkinsfile: Bypass running CI for fuzzer Cargo file changes" This reverts commit 0d0013c46e86c18d383f3e180fa8959091bba8b9. Grovvy shell script execution engine does not like backslash as the escape character. So we need to put another backslash to escape the backslash character. This would most likely fix the issue that we saw with the CI. Signed-off-by: Jinank Jain --- Jenkinsfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5ddaffe79..d0d9c2df0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,6 +23,19 @@ pipeline{ } } } + stage ('Check for fuzzer cargo files only changes') { + when { + expression { + return fuzzCargoFileOnly() + } + } + steps { + script { + runWorkers = false + echo "Fuzzer cargo files only changes, no need to run the CI" + } + } + } stage ('Check for RFC/WIP builds') { when { changeRequest comparator: 'REGEXP', title: '.*(rfc|RFC|wip|WIP).*' @@ -287,3 +300,14 @@ def boolean docsFileOnly() { script: "git diff --name-only origin/${env.CHANGE_TARGET}... | grep -v '\\.md'" ) != 0 } + +def boolean fuzzCargoFileOnly() { + if (env.CHANGE_TARGET == null) { + return false; + } + + return sh( + returnStatus: true, + script: "git diff --name-only origin/${env.CHANGE_TARGET}... | grep -v -E 'fuzz\\/Cargo.(toml|lock)'" + ) != 0 +}