@@ -3,18 +3,11 @@ name: GPU tests
3
3
on :
4
4
push :
5
5
branches : ["pull-request/[0-9]+"]
6
- # TODO: paths cannot be used since push happens to copied PR and only latest commit to PR is used
7
- # paths:
8
- # - ".github/workflows/gpu_tests.yml"
9
- # - "modelopt/**"
10
- # - "tests/gpu/**"
11
- # - "pyproject.toml"
12
- # - "setup.py"
13
- # - "tox.ini"
6
+ # NOTE: paths cannot be used since push happens to copied PR and only latest commit to PR is used
14
7
15
8
# Cancel previous runs if new commit is pushed to the same PR
16
9
concurrency :
17
- group : ${{ github.workflow }}-${{ github.ref }}
10
+ group : ${{ github.workflow }}-${{ github.sha }}
18
11
cancel-in-progress : true
19
12
20
13
jobs :
25
18
secrets : inherit
26
19
with :
27
20
match_pattern : ' ^DCO$'
21
+ check-changes :
22
+ needs : [wait-dco]
23
+ runs-on : ubuntu-latest
24
+ outputs :
25
+ any_changed : ${{ steps.changed-tests.outputs.any_changed }}
26
+ steps :
27
+ - id : get-pr-info
28
+ uses : nv-gha-runners/get-pr-info@main
29
+ - name : Check for changes in test-relevant directories
30
+ id : changed-tests
31
+ uses :
step-security/[email protected]
32
+ with :
33
+ files : |
34
+ .github/workflows/gpu_tests.yml
35
+ modelopt/**
36
+ tests/gpu/**
37
+ tox.ini
38
+ pyproject.toml
39
+ setup.py
40
+ base_sha : ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
28
41
wait-unit-tests :
29
42
needs : [wait-dco]
30
43
uses : ./.github/workflows/_wait_for_checks.yml
35
48
match_pattern : ' ^linux$' # Unit tests / linux
36
49
delay : 60s
37
50
gpu-tests :
38
- needs : [wait-unit-tests]
51
+ needs : [check-changes, wait-unit-tests]
52
+ if : needs.check-changes.outputs.any_changed == 'true'
39
53
# Runner list at https://github.com/nv-gha-runners/enterprise-runner-configuration/blob/main/docs/runner-groups.md
40
54
runs-on : linux-amd64-gpu-h100-latest-1
41
55
timeout-minutes : 60
47
61
PIP_CONSTRAINT : " " # Disable pip constraint for upgrading packages
48
62
steps :
49
63
- uses : actions/checkout@v4
50
- - name : Setup proxy cache
51
- uses : nv-gha-runners/setup-proxy-cache@main
64
+ - uses : nv-gha-runners/setup-proxy-cache@main
52
65
- name : Run gpu tests
53
66
run : pip install tox-current-env && tox -e py312-cuda12-gpu --current-env
0 commit comments