Skip to content

Commit bb6a568

Browse files
Add last aggregator job in unit/ pu CI to use as required check
Signed-off-by: Keval Morabia <[email protected]>
1 parent 8a07376 commit bb6a568

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/workflows/gpu_tests.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,27 @@ jobs:
2424
- uses: actions/checkout@v4
2525
- id: get-pr-info
2626
uses: nv-gha-runners/get-pr-info@main
27+
# Get commit from main branch that is present in the PR to use as base for changed files
28+
- id: calculate-merge-base
29+
env:
30+
PR_SHA: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).head.sha }}
31+
BASE_SHA: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.sha }}
32+
run: |
33+
(echo -n "merge-base="; git merge-base "$BASE_SHA" "$PR_SHA") | tee --append "${GITHUB_OUTPUT}"
2734
- name: Check for changes in test-relevant directories
2835
id: changed-tests
2936
uses: step-security/[email protected]
3037
with:
38+
base_sha: ${{ steps.calculate-merge-base.outputs.merge-base }}
39+
sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).head.sha }}
3140
files: |
3241
.github/workflows/gpu_tests.yml
3342
modelopt/**
3443
tests/gpu/**
3544
tox.ini
3645
pyproject.toml
3746
setup.py
38-
base_sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
47+
fail_on_initial_diff_error: true
3948
wait-checks:
4049
needs: [check-file-changes]
4150
if: needs.check-file-changes.outputs.any_changed == 'true'
@@ -70,3 +79,12 @@ jobs:
7079
timeout-minutes: 90
7180
container: *gpu_container
7281
steps: *gpu_steps
82+
gpu-pr-required-check:
83+
# Run even if gpu-tests-pr is skipped
84+
if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
85+
needs: [check-file-changes, gpu-tests-pr]
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Required GPU tests did not succeed
89+
if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
90+
run: exit 1

.github/workflows/unit_tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,9 @@ jobs:
126126
python-version: "3.12"
127127
- name: Run unit tests
128128
run: pip install tox && tox -e py312-partial-unit-${{ matrix.test-env }}
129+
unit-pr-required-check:
130+
if: github.event_name == 'pull_request'
131+
needs: [linux, windows, multi-py, multi-torch, multi-transformers, partial-install]
132+
runs-on: ubuntu-latest
133+
steps:
134+
- run: echo "All PR unit test jobs completed"

0 commit comments

Comments
 (0)