| 
30 | 30 |       - staging  | 
31 | 31 | 
 
  | 
32 | 32 | jobs:  | 
 | 33 | +  # Detect what changed to optimize workflow execution  | 
 | 34 | +  # This dramatically speeds up helm-only changes by skipping the 20+ minute build job  | 
 | 35 | +  changes:  | 
 | 36 | +    runs-on: ubuntu-latest  | 
 | 37 | +    outputs:  | 
 | 38 | +      code: ${{ steps.filter.outputs.code }}  | 
 | 39 | +      helm: ${{ steps.filter.outputs.helm }}  | 
 | 40 | +    steps:  | 
 | 41 | +      - uses: actions/checkout@v3  | 
 | 42 | +        with:  | 
 | 43 | +          fetch-depth: 0  # Fetch all history for accurate comparisons  | 
 | 44 | +        | 
 | 45 | +      - uses: dorny/paths-filter@v2  | 
 | 46 | +        id: filter  | 
 | 47 | +        with:  | 
 | 48 | +          # Compare against the previous commit on this branch (not master)  | 
 | 49 | +          # This way we only detect changes in the current push  | 
 | 50 | +          base: ${{ github.event.before }}  | 
 | 51 | +          filters: |  | 
 | 52 | +            code:  | 
 | 53 | +              - '**/*.java'  | 
 | 54 | +              - '**/*.xml'  | 
 | 55 | +              - '**/*.properties'  | 
 | 56 | +              - 'webapp/**'  | 
 | 57 | +              - 'repository/**'  | 
 | 58 | +              - 'intg/**'  | 
 | 59 | +              - 'graphdb/**'  | 
 | 60 | +              - 'pom.xml'  | 
 | 61 | +              - '**/pom.xml'  | 
 | 62 | +            helm:  | 
 | 63 | +              - 'helm/**'  | 
 | 64 | +    | 
 | 65 | +  # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  | 
 | 66 | +  # WORKFLOW EXECUTION PATHS:  | 
 | 67 | +  # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  | 
 | 68 | +  #  | 
 | 69 | +  # 📦 HELM-ONLY CHANGES (exclusively helm/** files):  | 
 | 70 | +  #    changes ✅ → helm-lint ✅ → build ⏭️ → smoke-test ⏭️ → helm-publish ✅  | 
 | 71 | +  #    ⏱️  Time: ~5 minutes (80% faster!)  | 
 | 72 | +  #  | 
 | 73 | +  # 💻 ANYTHING ELSE (code, maven.yml, Dockerfile, scripts, etc.):  | 
 | 74 | +  #    changes ✅ → helm-lint ✅ → build ✅ → smoke-test ✅/⏭️ → helm-publish ✅  | 
 | 75 | +  #    ⏱️  Time: ~25 minutes (full pipeline)  | 
 | 76 | +  #  | 
 | 77 | +  # Logic: Skip build ONLY if changes are exclusively in helm/**  | 
 | 78 | +  #  | 
 | 79 | +  # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  | 
 | 80 | + | 
33 | 81 |   helm-lint:  | 
34 | 82 |     runs-on: ubuntu-latest  | 
35 | 83 |     strategy:  | 
@@ -105,7 +153,10 @@ jobs:  | 
105 | 153 |           echo "✅ Chart.yaml validation passed for ${{ matrix.chart }}!"  | 
106 | 154 | 
  | 
107 | 155 |   build:  | 
108 |  | -    needs: helm-lint  | 
 | 156 | +    needs: [helm-lint, changes]  | 
 | 157 | +    # Skip build ONLY if changes are exclusively in helm/**  | 
 | 158 | +    # Run build for: code changes, workflow changes, Dockerfile, scripts, or anything else  | 
 | 159 | +    if: needs.changes.outputs.helm != 'true' || needs.changes.outputs.code == 'true'  | 
109 | 160 |     runs-on: ubuntu-latest  | 
110 | 161 | 
 
  | 
111 | 162 |     steps:  | 
@@ -365,11 +416,12 @@ jobs:  | 
365 | 416 | 
 
  | 
366 | 417 |   smoke-test:  | 
367 | 418 |     name: Multi-Cloud Smoke Test  | 
368 |  | -    needs: build  | 
 | 419 | +    needs: [build, changes]  | 
369 | 420 |     runs-on: ubuntu-latest  | 
370 |  | -    # Only run smoke tests on protected branches (beta, staging, master)  | 
371 |  | -    # Feature branches skip smoke tests but can still publish OCI charts for manual testing  | 
372 |  | -    if: github.ref_name == 'beta' || github.ref_name == 'staging' || github.ref_name == 'master'  | 
 | 421 | +    # Run smoke tests on protected branches if build ran (i.e., not helm-only changes)  | 
 | 422 | +    if: |  | 
 | 423 | +      needs.build.result == 'success' &&  | 
 | 424 | +      (github.ref_name == 'beta' || github.ref_name == 'staging' || github.ref_name == 'master')  | 
373 | 425 |       | 
374 | 426 |     # Concurrency control: Only one smoke test at a time across all branches  | 
375 | 427 |     # Shared vClusters cannot handle concurrent deployments  | 
@@ -513,10 +565,16 @@ jobs:  | 
513 | 565 |           path: smoke-test-logs/  | 
514 | 566 | 
 
  | 
515 | 567 |   helm-publish:  | 
516 |  | -    needs: [build, smoke-test]  | 
 | 568 | +    needs: [build, smoke-test, changes]  | 
517 | 569 |     runs-on: ubuntu-latest  | 
518 |  | -    # Run if smoke-test passed (protected branches) OR was skipped (feature branches)  | 
519 |  | -    if: always() && needs.build.result == 'success' && (needs.smoke-test.result == 'success' || needs.smoke-test.result == 'skipped')  | 
 | 570 | +    # Run helm-publish if:  | 
 | 571 | +    # 1. Build succeeded AND smoke-test passed/skipped: publish (code/workflow changes)  | 
 | 572 | +    # 2. Build skipped AND helm changed: publish (helm-only changes)  | 
 | 573 | +    if: |  | 
 | 574 | +      always() && (  | 
 | 575 | +        (needs.build.result == 'success' && (needs.smoke-test.result == 'success' || needs.smoke-test.result == 'skipped')) ||  | 
 | 576 | +        (needs.build.result == 'skipped' && needs.changes.outputs.helm == 'true')  | 
 | 577 | +      )  | 
520 | 578 |     strategy:  | 
521 | 579 |       matrix:  | 
522 | 580 |         include:  | 
 | 
0 commit comments