@@ -89,12 +89,26 @@ jobs:
8989 expect_l1 : ${{ steps.configure.outputs.expect_l1 }}
9090 expect_l2 : ${{ steps.configure.outputs.expect_l2 }}
9191 perf_scripts_only : ${{ steps.configure.outputs.perf_scripts_only }}
92+ merge_sha : ${{ steps.merge-sha.outputs.merge_sha }}
9293 steps :
9394 - name : Get PR info
9495 id : get-pr-info
9596 if : startsWith(github.ref, 'refs/heads/pull-request/')
9697 uses : nv-gha-runners/get-pr-info@main
9798
99+ - name : Resolve merge commit sha
100+ id : merge-sha
101+ shell : bash -e -u -o pipefail {0}
102+ env :
103+ IS_PR : ${{ startsWith(github.ref, 'refs/heads/pull-request/') }}
104+ run : |
105+ if [[ "$IS_PR" == "true" ]]; then
106+ SHA=${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').merge_commit_sha }}
107+ else
108+ SHA=${GITHUB_SHA}
109+ fi
110+ echo "merge_sha=${SHA}" | tee -a "$GITHUB_OUTPUT"
111+
98112 - name : Configure
99113 id : configure
100114 shell : bash -x -e -u -o pipefail {0}
@@ -220,7 +234,7 @@ jobs:
220234 lint-check :
221235 name : Lint check
222236 runs-on : ubuntu-latest
223- needs : [pre-flight]
237+ needs : [pre-flight, configure ]
224238 if : |
225239 needs.pre-flight.outputs.is_deployment_workflow == 'false'
226240 || github.event_name == 'workflow_dispatch'
@@ -229,6 +243,7 @@ jobs:
229243 uses : actions/checkout@v6
230244 with :
231245 submodules : " recursive"
246+ ref : ${{ needs.configure.outputs.merge_sha }}
232247
233248 - name : Update MCore submodule (if triggered from MCore)
234249 if : ${{ github.event.inputs.mcore_ref != '' }}
@@ -325,24 +340,11 @@ jobs:
325340 if : startsWith(github.ref, 'refs/heads/pull-request/')
326341 uses : nv-gha-runners/get-pr-info@main
327342
328- - name : Get merge commit sha
329- shell : bash -x -e -u -o pipefail {0}
330- id : sha
331- env :
332- IS_PR : ${{ startsWith(github.ref, 'refs/heads/pull-request/') }}
333- run : |
334- if [[ "$IS_PR" == "true" ]]; then
335- SHA=${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').merge_commit_sha }}
336- else
337- SHA=${GITHUB_SHA}
338- fi
339- echo "main=${SHA}" | tee -a "$GITHUB_OUTPUT"
340-
341343 - name : Checkout
342344 uses : actions/checkout@v6
343345 with :
344346 submodules : recursive
345- ref : ${{ steps.sha .outputs.main }}
347+ ref : ${{ needs.configure .outputs.merge_sha }}
346348
347349 - name : Update MCore submodule (if triggered from MCore)
348350 if : ${{ github.event.inputs.mcore_ref != '' }}
@@ -464,7 +466,7 @@ jobs:
464466 no-cache : false
465467 tags : |
466468 ${{ matrix.registry }}/megatron-bridge:${{ steps.cache_keys.outputs.key }}
467- ${{ matrix.registry }}/megatron-bridge:${{ github.sha }}
469+ ${{ matrix.registry }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
468470 secrets : |
469471 GH_TOKEN=${{ secrets.PAT }}
470472
@@ -484,11 +486,13 @@ jobs:
484486 steps :
485487 - name : Checkout
486488 uses : actions/checkout@v6
489+ with :
490+ ref : ${{ needs.configure.outputs.merge_sha }}
487491
488492 - name : Run venv import check
489493 shell : bash -e -u -o pipefail {0}
490494 env :
491- IMAGE : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ github.sha }}
495+ IMAGE : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
492496 run : |
493497 docker run --rm \
494498 -v "${{ github.workspace }}/docker/common:/opt/import-check:ro" \
@@ -507,7 +511,7 @@ jobs:
507511 )
508512 && !cancelled()
509513 && (github.event.inputs.test_suite == '' || github.event.inputs.test_suite == 'all' || github.event.inputs.test_suite == 'unit-only' || contains('L0 L1 L2', github.event.inputs.test_suite))
510- needs : [pre-flight, cicd-wait-in-queue, cicd-container-build]
514+ needs : [pre-flight, configure, cicd-wait-in-queue, cicd-container-build]
511515 runs-on : ${{ needs.pre-flight.outputs.runner_prefix }}
512516 name : Launch_Unit_Tests_Core
513517 env :
@@ -518,6 +522,7 @@ jobs:
518522 uses : actions/checkout@v6
519523 with :
520524 submodules : recursive
525+ ref : ${{ needs.configure.outputs.merge_sha }}
521526
522527 - name : main
523528 uses : ./.github/actions/test-template
@@ -526,7 +531,7 @@ jobs:
526531 timeout : 18
527532 is_unit_test : " true"
528533 PAT : ${{ secrets.PAT }}
529- container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ github.sha }}
534+ container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
530535 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
531536 runner : ${{ needs.pre-flight.outputs.runner_prefix }}
532537
@@ -540,7 +545,7 @@ jobs:
540545 )
541546 && !cancelled()
542547 && (github.event.inputs.test_suite == '' || github.event.inputs.test_suite == 'all' || github.event.inputs.test_suite == 'unit-only' || contains('L0 L1 L2', github.event.inputs.test_suite))
543- needs : [pre-flight, cicd-wait-in-queue, cicd-container-build]
548+ needs : [pre-flight, configure, cicd-wait-in-queue, cicd-container-build]
544549 runs-on : ${{ needs.pre-flight.outputs.runner_prefix }}
545550 name : Launch_Unit_Tests_Diffusion
546551 env :
@@ -551,6 +556,7 @@ jobs:
551556 uses : actions/checkout@v6
552557 with :
553558 submodules : recursive
559+ ref : ${{ needs.configure.outputs.merge_sha }}
554560
555561 - name : main
556562 uses : ./.github/actions/test-template
@@ -559,12 +565,12 @@ jobs:
559565 timeout : 18
560566 is_unit_test : " true"
561567 PAT : ${{ secrets.PAT }}
562- container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ github.sha }}
568+ container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
563569 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
564570 runner : ${{ needs.pre-flight.outputs.runner_prefix }}
565571
566572 generate-test-matrix :
567- needs : [pre-flight, cicd-container-build]
573+ needs : [pre-flight, configure, cicd-container-build]
568574 runs-on : ubuntu-latest
569575 outputs :
570576 matrix_l0 : ${{ steps.scan.outputs.matrix_l0 }}
@@ -581,6 +587,8 @@ jobs:
581587 && !cancelled()
582588 steps :
583589 - uses : actions/checkout@v6
590+ with :
591+ ref : ${{ needs.configure.outputs.merge_sha }}
584592 - id : scan
585593 shell : bash
586594 env :
@@ -629,7 +637,7 @@ jobs:
629637 fail-fast : false
630638 max-parallel : 16
631639 matrix : ${{ fromJSON(needs.generate-test-matrix.outputs.matrix_l0) }}
632- needs : [pre-flight, generate-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
640+ needs : [pre-flight, configure, generate-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
633641 runs-on : ${{ matrix.runner }}
634642 if : |
635643 (
@@ -650,6 +658,7 @@ jobs:
650658 uses : actions/checkout@v6
651659 with :
652660 submodules : recursive
661+ ref : ${{ needs.configure.outputs.merge_sha }}
653662
654663 - name : main
655664 uses : ./.github/actions/test-template
@@ -658,7 +667,7 @@ jobs:
658667 timeout : ${{ fromJSON(matrix.timeout || '30') }}
659668 is_unit_test : " false"
660669 PAT : ${{ secrets.PAT }}
661- container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ github.sha }}
670+ container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
662671 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
663672 runner : ${{ matrix.runner }}
664673
@@ -690,6 +699,7 @@ jobs:
690699 uses : actions/checkout@v6
691700 with :
692701 submodules : recursive
702+ ref : ${{ needs.configure.outputs.merge_sha }}
693703
694704 - name : main
695705 uses : ./.github/actions/test-template
@@ -698,7 +708,7 @@ jobs:
698708 timeout : ${{ fromJSON(matrix.timeout || '30') }}
699709 is_unit_test : " false"
700710 PAT : ${{ secrets.PAT }}
701- container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ github.sha }}
711+ container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
702712 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
703713 runner : ${{ matrix.runner }}
704714
@@ -730,6 +740,7 @@ jobs:
730740 uses : actions/checkout@v6
731741 with :
732742 submodules : recursive
743+ ref : ${{ needs.configure.outputs.merge_sha }}
733744
734745 - name : main
735746 uses : ./.github/actions/test-template
@@ -738,7 +749,7 @@ jobs:
738749 timeout : ${{ fromJSON(matrix.timeout || '30') }}
739750 is_unit_test : " false"
740751 PAT : ${{ secrets.PAT }}
741- container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ github.sha }}
752+ container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
742753 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
743754 runner : ${{ matrix.runner }}
744755
@@ -748,7 +759,7 @@ jobs:
748759 fail-fast : false
749760 max-parallel : 16
750761 matrix : ${{ fromJSON(needs.generate-test-matrix.outputs.matrix_flaky) }}
751- needs : [pre-flight, generate-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
762+ needs : [pre-flight, configure, generate-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
752763 runs-on : ${{ matrix.runner }}
753764 name : ${{ matrix.script }}
754765 env :
@@ -760,6 +771,7 @@ jobs:
760771 uses : actions/checkout@v6
761772 with :
762773 submodules : recursive
774+ ref : ${{ needs.configure.outputs.merge_sha }}
763775
764776 - name : main
765777 uses : ./.github/actions/test-template
@@ -769,12 +781,12 @@ jobs:
769781 timeout : ${{ fromJSON(matrix.timeout || '30') }}
770782 is_unit_test : " false"
771783 PAT : ${{ secrets.PAT }}
772- container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ github.sha }}
784+ container-image : ${{ needs.pre-flight.outputs.registry }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
773785 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
774786 runner : ${{ matrix.runner }}
775787
776788 generate-gb200-test-matrix :
777- needs : [pre-flight, cicd-container-build]
789+ needs : [pre-flight, configure, cicd-container-build]
778790 runs-on : ubuntu-latest
779791 outputs :
780792 matrix_gb200_l0 : ${{ steps.scan.outputs.matrix_gb200_l0 }}
@@ -792,6 +804,8 @@ jobs:
792804 && needs.pre-flight.outputs.is_member == 'true'
793805 steps :
794806 - uses : actions/checkout@v6
807+ with :
808+ ref : ${{ needs.configure.outputs.merge_sha }}
795809 - id : scan
796810 shell : bash
797811 run : |
@@ -838,7 +852,7 @@ jobs:
838852 fail-fast : false
839853 max-parallel : 16
840854 matrix : ${{ fromJSON(needs.generate-gb200-test-matrix.outputs.matrix_gb200_l0) }}
841- needs : [pre-flight, generate-gb200-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
855+ needs : [pre-flight, configure, generate-gb200-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
842856 runs-on : ${{ matrix.runner }}
843857 if : |
844858 (
@@ -861,6 +875,7 @@ jobs:
861875 uses : actions/checkout@v6
862876 with :
863877 submodules : recursive
878+ ref : ${{ needs.configure.outputs.merge_sha }}
864879
865880 - name : main
866881 uses : ./.github/actions/test-template
@@ -874,7 +889,7 @@ jobs:
874889 azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
875890 azure-subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
876891 PAT : ${{ secrets.PAT }}
877- container-image : ${{ env.container-registry-gb200 }}/megatron-bridge:${{ github.sha }}
892+ container-image : ${{ env.container-registry-gb200 }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
878893 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
879894 runner : ${{ matrix.runner }}
880895
@@ -908,6 +923,7 @@ jobs:
908923 uses : actions/checkout@v6
909924 with :
910925 submodules : recursive
926+ ref : ${{ needs.configure.outputs.merge_sha }}
911927
912928 - name : main
913929 uses : ./.github/actions/test-template
@@ -921,7 +937,7 @@ jobs:
921937 azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
922938 azure-subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
923939 PAT : ${{ secrets.PAT }}
924- container-image : ${{ env.container-registry-gb200 }}/megatron-bridge:${{ github.sha }}
940+ container-image : ${{ env.container-registry-gb200 }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
925941 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
926942 runner : ${{ matrix.runner }}
927943
@@ -955,6 +971,7 @@ jobs:
955971 uses : actions/checkout@v6
956972 with :
957973 submodules : recursive
974+ ref : ${{ needs.configure.outputs.merge_sha }}
958975
959976 - name : main
960977 uses : ./.github/actions/test-template
@@ -968,7 +985,7 @@ jobs:
968985 azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
969986 azure-subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
970987 PAT : ${{ secrets.PAT }}
971- container-image : ${{ env.container-registry-gb200 }}/megatron-bridge:${{ github.sha }}
988+ container-image : ${{ env.container-registry-gb200 }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
972989 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
973990 runner : ${{ matrix.runner }}
974991
@@ -978,7 +995,7 @@ jobs:
978995 fail-fast : false
979996 max-parallel : 16
980997 matrix : ${{ fromJSON(needs.generate-gb200-test-matrix.outputs.matrix_gb200_flaky) }}
981- needs : [pre-flight, generate-gb200-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
998+ needs : [pre-flight, configure, generate-gb200-test-matrix, cicd-unit-tests-core, cicd-unit-tests-diffusion]
982999 runs-on : ${{ matrix.runner }}
9831000 name : gb200_${{ matrix.script }}
9841001 environment : ${{ contains(needs.pre-flight.outputs.registry, 'azure') && 'nemo-ci' || '' }}
@@ -991,6 +1008,7 @@ jobs:
9911008 uses : actions/checkout@v6
9921009 with :
9931010 submodules : recursive
1011+ ref : ${{ needs.configure.outputs.merge_sha }}
9941012
9951013 - name : main
9961014 uses : ./.github/actions/test-template
@@ -1004,7 +1022,7 @@ jobs:
10041022 azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
10051023 azure-subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
10061024 PAT : ${{ secrets.PAT }}
1007- container-image : ${{ env.container-registry-gb200 }}/megatron-bridge:${{ github.sha }}
1025+ container-image : ${{ env.container-registry-gb200 }}/megatron-bridge:${{ needs.configure.outputs.merge_sha }}
10081026 test-data-path : ${{ needs.pre-flight.outputs.test_data_path }}
10091027 runner : ${{ matrix.runner }}
10101028
@@ -1027,6 +1045,8 @@ jobs:
10271045 steps :
10281046 - name : Checkout
10291047 uses : actions/checkout@v6
1048+ with :
1049+ ref : ${{ needs.configure.outputs.merge_sha }}
10301050
10311051 - name : Get workflow result
10321052 id : result
@@ -1126,6 +1146,8 @@ jobs:
11261146
11271147 - name : Checkout
11281148 uses : actions/checkout@v6
1149+ with :
1150+ ref : ${{ needs.configure.outputs.merge_sha }}
11291151
11301152 - name : Download coverage reports of current branch
11311153 uses : actions/download-artifact@v7
0 commit comments