Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/gpu_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,31 @@ jobs:
any_changed: ${{ steps.changed-tests.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: get-pr-info
uses: nv-gha-runners/get-pr-info@main
# Get commit from main branch that is present in the PR to use as base for changed files
- id: calculate-merge-base
env:
PR_SHA: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).head.sha }}
BASE_SHA: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.sha }}
run: |
(echo -n "merge-base="; git merge-base "$BASE_SHA" "$PR_SHA") | tee --append "${GITHUB_OUTPUT}"
- name: Check for changes in test-relevant directories
id: changed-tests
uses: step-security/[email protected]
with:
base_sha: ${{ steps.calculate-merge-base.outputs.merge-base }}
sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).head.sha }}
files: |
.github/workflows/gpu_tests.yml
modelopt/**
tests/gpu/**
tox.ini
pyproject.toml
setup.py
base_sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
fail_on_initial_diff_error: true
wait-checks:
needs: [check-file-changes]
if: needs.check-file-changes.outputs.any_changed == 'true'
Expand Down Expand Up @@ -70,3 +81,12 @@ jobs:
timeout-minutes: 90
container: *gpu_container
steps: *gpu_steps
gpu-pr-required-check:
# Run even if gpu-tests-pr is skipped
if: ${{ startsWith(github.ref, 'refs/heads/pull-request/') && always() }}
needs: [check-file-changes, gpu-tests-pr]
runs-on: ubuntu-latest
steps:
- name: Required GPU tests did not succeed
if: ${{ needs.check-file-changes.outputs.any_changed == 'true' && needs.gpu-tests-pr.result != 'success' }}
run: exit 1
6 changes: 6 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,9 @@ jobs:
python-version: "3.12"
- name: Run unit tests
run: pip install tox && tox -e py312-partial-unit-${{ matrix.test-env }}
unit-pr-required-check:
if: github.event_name == 'pull_request'
needs: [linux, windows, multi-py, multi-torch, multi-transformers, partial-install]
runs-on: ubuntu-latest
steps:
- run: echo "All PR unit test jobs completed"
Loading