From 428c464de201650519f030701a3b74d5032dd239 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sat, 19 Oct 2024 20:28:17 +0200 Subject: [PATCH] Update common-tests.yaml Signed-off-by: Kjeld Schouten --- .github/workflows/common-tests.yaml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/common-tests.yaml b/.github/workflows/common-tests.yaml index 4bc348de386..090945a8e2a 100644 --- a/.github/workflows/common-tests.yaml +++ b/.github/workflows/common-tests.yaml @@ -20,9 +20,29 @@ on: workflow_dispatch: jobs: + + check_changes: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Check for changes in specific folder + id: check_changes + run: | + if git diff --exit-code HEAD^ HEAD -- path/to/your/folder; then + echo "No changes detected in the folder." + echo "::set-output name=changes_detected::false" + else + echo "Changes detected in the folder." + echo "::set-output name=changes_detected::true" + fi + lint: name: Lint Common runs-on: ubuntu-24.04 + if: needs.check_changes.outputs.changes_detected == 'true' strategy: fail-fast: false matrix: @@ -255,9 +275,9 @@ jobs: steps: - name: Check Results run: | - if [[ "${{ needs.lint.result }}" != "success" || \ + if [[ "${{ needs.check_changes.outputs.changes_detected }}" == 'true' && ( "${{ needs.lint.result }}" != "success" || \ "${{ needs.unittest.result }}" != "success" || \ - "${{ needs.install.result }}" != "success" ]]; then + "${{ needs.install.result }}" != "success") ]]; then echo "One or more jobs failed!" exit 1 else