2121 - r**
2222 - weekly-bump*
2323 types : [labeled]
24- push :
25- branches :
26- - main
2724 workflow_dispatch :
2825 inputs :
2926 test_to_run :
@@ -134,11 +131,12 @@ jobs:
134131 uses : ./.github/workflows/code-linting.yml
135132
136133 cicd-wait-in-queue :
137- needs : [pre-flight]
134+ needs : [pre-flight, code-linting ]
138135 runs-on : ubuntu-latest
139136 environment : test
140137 if : |
141138 needs.pre-flight.outputs.test_to_run != '[]'
139+ && needs.pre-flight.outputs.components_to_run != '[]'
142140 && needs.pre-flight.outputs.is_ci_workload == 'false'
143141 steps :
144142 - name : Running CI tests
@@ -150,6 +148,7 @@ jobs:
150148 needs : [pre-flight, code-linting, cicd-wait-in-queue]
151149 if : |
152150 needs.pre-flight.outputs.test_to_run != '[]'
151+ && needs.pre-flight.outputs.components_to_run != '[]'
153152 && (
154153 success()
155154 || (
@@ -165,6 +164,7 @@ jobs:
165164 cicd-import-tests :
166165 if : |
167166 needs.pre-flight.outputs.test_to_run != '[]'
167+ && needs.pre-flight.outputs.components_to_run != '[]'
168168 && (
169169 success()
170170 || (
@@ -214,6 +214,7 @@ jobs:
214214 runs-on : self-hosted-azure
215215 if : |
216216 needs.pre-flight.outputs.test_to_run != '[]'
217+ && needs.pre-flight.outputs.components_to_run != '[]'
217218 && (
218219 success()
219220 || (
@@ -240,6 +241,7 @@ jobs:
240241 uses : ./.github/workflows/cicd-main-unit-tests.yml
241242 if : |
242243 needs.pre-flight.outputs.test_to_run != '[]'
244+ && needs.pre-flight.outputs.components_to_run != '[]'
243245 && (
244246 success()
245247 || (
@@ -360,12 +362,14 @@ jobs:
360362 GH_TOKEN : ${{ github.token }}
361363 RUN_ID : ${{ github.run_id }}
362364 HAS_LABEL : ${{ github.event.label.name == 'Run CICD' }}
365+ IS_SCHEDULED : ${{ github.event_name == 'schedule' }}
363366 run : |
364367 # Get workflow run details and check job conclusions
368+ LATEST_ATTEMPT=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion != null) | .conclusion] | last')
365369 NUM_FAILED=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion == "failure") | .name] | length')
366370 NUM_CANCELLED=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion == "cancelled") | .name] | length')
367371
368- if [[ $NUM_FAILED -eq 0 && $NUM_CANCELLED -eq 0 && "$HAS_LABEL" == "true" ]]; then
372+ if [[ $NUM_FAILED -eq 0 && $NUM_CANCELLED -eq 0 && ( "$HAS_LABEL" == "true" || "$IS_SCHEDULED" == "true") ]]; then
369373 RESULT="success"
370374 elif [[ $NUM_CANCELLED -gt 0 ]]; then
371375 RESULT="cancelled"
@@ -445,9 +449,11 @@ jobs:
445449
446450 Coverage :
447451 runs-on : ubuntu-latest
448- needs : [Nemo_CICD_Test]
452+ needs : [pre-flight, Nemo_CICD_Test]
449453 if : |
450- (
454+ needs.pre-flight.outputs.test_to_run != '[]'
455+ && needs.pre-flight.outputs.components_to_run != '[]'
456+ && (
451457 success()
452458 || needs.Nemo_CICD_Test.result == 'success'
453459 )
0 commit comments