@@ -19,38 +19,12 @@ name: 'test'
19
19
20
20
on :
21
21
push :
22
- # Enable merged test per commit
23
22
branches :
24
23
- ' main'
25
- paths :
26
- - ' *.txt'
27
- - ' **/*.py'
28
- - ' .github/workflows/vllm_ascend_test.yaml'
29
- - ' !docs/**'
30
- - ' pytest.ini'
31
- - ' !benchmarks/**'
32
- - ' tools/mypy.sh'
33
- - ' mypy.ini'
34
- - ' .github/workflows/*.ya?ml'
35
- - ' .github/workflows/actionlint.*'
36
- - ' .github/workflows/matchers/actionlint.json'
37
24
pull_request :
38
25
branches :
39
26
- ' main'
40
27
- ' *-dev'
41
- paths :
42
- - ' *.txt'
43
- - ' **/*.py'
44
- - ' .github/workflows/vllm_ascend_test.yaml'
45
- - ' !docs/**'
46
- - ' !examples/**'
47
- - ' pytest.ini'
48
- - ' !benchmarks/**'
49
- - ' tools/mypy.sh'
50
- - ' mypy.ini'
51
- - ' .github/workflows/*.ya?ml'
52
- - ' .github/workflows/actionlint.*'
53
- - ' .github/workflows/matchers/actionlint.json'
54
28
55
29
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
56
30
# declared as "shell: bash -el {0}" on steps that need to be properly activated.
@@ -71,11 +45,35 @@ jobs:
71
45
if : ${{ github.event_name == 'pull_request' }}
72
46
uses : ./.github/workflows/pre-commit.yml
73
47
48
+ changes :
49
+ # Only trigger changes on pull request
50
+ if : ${{ github.event_name == 'pull_request' }}
51
+ runs-on : ubuntu-latest
52
+ permissions :
53
+ pull-requests : read
54
+ outputs :
55
+ e2e_tracker : ${{ steps.filter.outputs.e2e_tracker }}
56
+ ut_tracker : ${{ steps.filter.outputs.ut_tracker }}
57
+ steps :
58
+ - uses : dorny/paths-filter@v3
59
+ id : filter
60
+ with :
61
+ filters : |
62
+ e2e_tracker:
63
+ - 'vllm_ascend/**'
64
+ - 'csrc/**'
65
+ - 'cmake/**'
66
+ - 'tests/e2e/**'
67
+ - 'tests/conftest.py'
68
+ - 'tests/model_utils.py'
69
+ - 'tests/utils.py'
70
+ ut_tracker:
71
+ - 'tests/ut/**'
74
72
ut :
75
- needs : [lint]
73
+ needs : [lint, changes ]
76
74
name : unit test
77
- # only trigger e2e test on [pull request after lint passed] and [merged commit]
78
- if : ${{ needs.lint.result == 'success' || github.event_name == 'push' }}
75
+ # only trigger unit test after lint passed and the change is e2e and ut related. Or the PR is merged.
76
+ if : ${{ github.event_name == 'push' || ( needs.lint.result == 'success' && (needs.changes.outputs.e2e_tracker == 'true' || needs.changes.outputs.ut_tracker == 'true')) }}
79
77
runs-on : ubuntu-latest
80
78
container :
81
79
image : quay.io/ascend/cann:8.1.rc1-910b-ubuntu22.04-py3.10
@@ -134,9 +132,9 @@ jobs:
134
132
verbose : true
135
133
136
134
e2e :
137
- needs : [lint]
138
- # only trigger e2e test on pull request after lint passed
139
- if : ${{ needs.lint.result == 'success' && github.event_name == 'pull_request ' }}
135
+ needs : [lint, changes ]
136
+ # only trigger e2e test after lint passed and the change is e2e related.
137
+ if : ${{ needs.lint.result == 'success' && needs.changes.outputs.e2e_tracker == 'true ' }}
140
138
strategy :
141
139
max-parallel : 2
142
140
matrix :
0 commit comments