@@ -17,7 +17,22 @@ permissions:
1717 contents : read
1818
1919jobs :
20- changes :
20+ changed-files :
21+ runs-on : ubuntu-latest
22+ # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-defining-outputs-for-a-job
23+ outputs :
24+ files : ${{ steps.get_files.outputs.changed_files }}
25+ steps :
26+ - uses : actions/checkout@v6
27+
28+ - id : get_files
29+ run : |
30+ echo "changed_files=$(python3 .github/get_files_changed_in_pr.py)" >> $GITHUB_OUTPUT
31+ env :
32+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33+ GITHUB_PR_NUMBER : ${{ github.event.pull_request.number }}
34+
35+ job-filters :
2136 runs-on : ubuntu-latest
2237 outputs :
2338 source : ${{ steps.filter.outputs.source }}
@@ -36,15 +51,18 @@ jobs:
3651
3752 ubuntu :
3853 runs-on : ubuntu-latest
39- needs : changes
40- if : needs.changes.outputs.ci-build == 'true'
54+ needs : changed-files
55+ needs : job-filters
56+ if : needs.job-filters.outputs.source.ci-build == 'true'
4157 strategy :
4258 fail-fast : false
4359 matrix :
4460 build-type : [Custom, FullDebug]
4561 compiler : [gcc, clang]
4662 env :
4763 KRATOS_BUILD_TYPE : ${{ matrix.build-type }}
64+ KRATOS_CI_CHANGED_FILES : ${{needs.changed-files.outputs.files}}
65+ KRATOS_CI_APPLICATIONS : " .github/workflows/ci_apps_linux.json"
4866 KRATOS_CI_CORES : 4 # Current limits are 4 CPU and 16 GB Ram
4967 OMPI_MCA_rmaps_base_oversubscribe : 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0)
5068 OMPI_MCA_btl_vader_single_copy_mechanism : none # Suppressing some annoying OpenMPI messages
@@ -248,10 +266,13 @@ jobs:
248266
249267 windows :
250268 runs-on : windows-2022
251- needs : changes
252- if : needs.changes.outputs.ci-build == 'true'
269+ needs : changed-files
270+ needs : job-filters
271+ if : needs.job-filters.outputs.source.ci-build == 'true'
253272 env :
254273 KRATOS_BUILD_TYPE : Custom
274+ KRATOS_CI_CHANGED_FILES : ${{needs.changed-files.outputs.files}}
275+ KRATOS_CI_APPLICATIONS : " .github/workflows/ci_apps_windows.json"
255276
256277 steps :
257278 - uses : actions/checkout@v6
@@ -303,10 +324,13 @@ jobs:
303324
304325 rocky :
305326 runs-on : ubuntu-latest
306- needs : changes
307- if : needs.changes.outputs.ci-build == 'true'
327+ needs : changed-files
328+ needs : job-filters
329+ if : needs.job-filters.outputs.source.ci-build == 'true'
308330 env :
309331 KRATOS_BUILD_TYPE : Custom
332+ KRATOS_CI_CHANGED_FILES : ${{needs.changed-files.outputs.files}}
333+ KRATOS_CI_APPLICATIONS : " .github/workflows/ci_apps_rocky.json"
310334 ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
311335
312336 container :
@@ -347,10 +371,13 @@ jobs:
347371
348372 ubuntu-core-without-unity :
349373 runs-on : ubuntu-latest
350- needs : changes
351- if : needs.changes.outputs.ci-build == 'true'
374+ needs : changed-files
375+ needs : job-filters
376+ if : needs.job-filters.outputs.source.ci-build == 'true'
352377 env :
353378 KRATOS_BUILD_TYPE : Custom
379+ KRATOS_CI_CHANGED_FILES : ${{needs.changed-files.outputs.files}}
380+ KRATOS_CI_APPLICATIONS : " ONLY_CORE"
354381 OMPI_MCA_rmaps_base_oversubscribe : 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0)
355382
356383 container :
@@ -463,10 +490,13 @@ jobs:
463490
464491 windows-core-without-unity :
465492 runs-on : windows-2022
466- needs : changes
467- if : needs.changes.outputs.ci-build == 'true'
493+ needs : changed-files
494+ needs : job-filters
495+ if : needs.job-filters.outputs.source.ci-build == 'true'
468496 env :
469497 KRATOS_BUILD_TYPE : Custom
498+ KRATOS_CI_CHANGED_FILES : ${{needs.changed-files.outputs.files}}
499+ KRATOS_CI_APPLICATIONS : " ONLY_CORE"
470500
471501 steps :
472502 - uses : actions/checkout@v6
@@ -546,10 +576,13 @@ jobs:
546576
547577 ubuntu-intel :
548578 runs-on : ubuntu-latest
549- needs : changes
550- if : needs.changes.outputs.ci-build == 'true'
579+ needs : changed-files
580+ needs : job-filters
581+ if : needs.job-filters.outputs.source.ci-build == 'true'
551582 env :
552583 KRATOS_BUILD_TYPE : Custom
584+ KRATOS_CI_CHANGED_FILES : ${{needs.changed-files.outputs.files}}
585+ KRATOS_CI_APPLICATIONS : " .github/workflows/ci_apps_intel.json"
553586 OMPI_MCA_rmaps_base_oversubscribe : 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0)
554587 OMPI_MCA_btl_vader_single_copy_mechanism : none # suppressing some annoying OpenMPI messages
555588
0 commit comments