From a8e3d474bc57cc5cb67ac971b56d7004b0ae6c81 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Thu, 10 Jul 2025 15:22:07 +0200 Subject: chore: refactor github actions and Jenkinsfile to only execute when required --- contrib/depends/Jenkinsfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'contrib') diff --git a/contrib/depends/Jenkinsfile b/contrib/depends/Jenkinsfile index 7b73319..e7661af 100644 --- a/contrib/depends/Jenkinsfile +++ b/contrib/depends/Jenkinsfile @@ -25,7 +25,33 @@ pipeline { } stages { + stage('Check Changes') { + agent any + steps { + script { + def changes = sh( + script: "git diff --name-only HEAD~1 HEAD | grep '^contrib/depends' || echo 'NO_CHANGES'", + returnStdout: true + ).trim() + + if (changes == 'NO_CHANGES') { + echo "No changes detected in contrib/depends directory. Skipping build." + currentBuild.result = 'NOT_BUILT' + return + } else { + echo "Changes detected in contrib/depends directory:" + echo changes + } + } + } + } + stage('Build Dependencies') { + when { + not { + equals expected: 'NOT_BUILT', actual: currentBuild.result + } + } parallel { stage('Linux Builds') { agent { -- cgit v1.2.3