Skip to content

Commit 69523f1

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

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/workflows/gpu_tests.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,28 @@ 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+
- name: Calculate merge base
29+
id: calculate-merge-base
30+
env:
31+
PR_SHA: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).head.sha }}
32+
BASE_SHA: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.sha }}
33+
run: |
34+
(echo -n "merge-base="; git merge-base "$BASE_SHA" "$PR_SHA") | tee --append "${GITHUB_OUTPUT}"
2735
- name: Check for changes in test-relevant directories
2836
id: changed-tests
2937
uses: step-security/[email protected]
38+
continue-on-error: true
3039
with:
40+
base_sha: ${{ steps.calculate-merge-base.outputs.merge-base }}
3141
files: |
3242
.github/workflows/gpu_tests.yml
3343
modelopt/**
3444
tests/gpu/**
3545
tox.ini
3646
pyproject.toml
3747
setup.py
38-
base_sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
48+
fail_on_initial_diff_error: true
3949
wait-checks:
4050
needs: [check-file-changes]
4151
if: needs.check-file-changes.outputs.any_changed == 'true'
@@ -70,3 +80,12 @@ jobs:
7080
timeout-minutes: 90
7181
container: *gpu_container
7282
steps: *gpu_steps
83+
gpu-pr-required-check:
84+
# Run even if gpu-tests-pr is skipped
85+
if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
86+
needs: [check-file-changes, gpu-tests-pr]
87+
runs-on: ubuntu-latest
88+
steps:
89+
- name: Required GPU tests did not succeed
90+
if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
91+
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)