Skip to content

Commit 458c054

Browse files
Add last aggregator job in unit/gpu CI test as required check
Signed-off-by: Keval Morabia <[email protected]>
1 parent 2b52759 commit 458c054

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.github/workflows/gpu_tests.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ jobs:
1919
if: startsWith(github.ref, 'refs/heads/pull-request/')
2020
runs-on: ubuntu-latest
2121
outputs:
22-
any_changed: ${{ steps.changed-tests.outputs.any_changed }}
22+
any_changed: ${{ steps.compute-any-changed.outputs.any_changed }}
2323
steps:
2424
- uses: actions/checkout@v4
2525
- id: get-pr-info
2626
uses: nv-gha-runners/get-pr-info@main
2727
- name: Check for changes in test-relevant directories
2828
id: changed-tests
2929
uses: step-security/[email protected]
30+
continue-on-error: true
3031
with:
3132
files: |
3233
.github/workflows/gpu_tests.yml
@@ -36,6 +37,17 @@ jobs:
3637
pyproject.toml
3738
setup.py
3839
base_sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
40+
# Sometimes fails if commits are force pushed on the PR
41+
fail_on_initial_diff_error: true
42+
- name: Compute any_changed (fallback to true on failure)
43+
id: compute-any-changed
44+
if: ${{ always() }}
45+
run: |
46+
if [ "${{ steps.changed-tests.outcome }}" != "success" ]; then
47+
echo "any_changed=true" >> "$GITHUB_OUTPUT"
48+
else
49+
echo "any_changed=${{ steps.changed-tests.outputs.any_changed }}" >> "$GITHUB_OUTPUT"
50+
fi
3951
wait-checks:
4052
needs: [check-file-changes]
4153
if: needs.check-file-changes.outputs.any_changed == 'true'
@@ -70,3 +82,12 @@ jobs:
7082
timeout-minutes: 90
7183
container: *gpu_container
7284
steps: *gpu_steps
85+
gpu-pr-required-check:
86+
# Run even if gpu-tests-pr is skipped
87+
if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
88+
needs: [check-file-changes, gpu-tests-pr]
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Required GPU tests did not succeed
92+
if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
93+
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)