Skip to content

Commit c0f519f

Browse files
committed
test split out
1 parent 3cdb9b0 commit c0f519f

File tree

2 files changed

+31
-30
lines changed

2 files changed

+31
-30
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: GPU Tests Pending
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
set-pending:
11+
name: GPU Tests Pending
12+
runs-on: ubuntu-latest
13+
permissions:
14+
statuses: write
15+
steps:
16+
- name: Set pending status on PR
17+
run: |
18+
for context in "CI-Pass" "All Tests Green"; do
19+
gh api repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
20+
-f state=pending \
21+
-f context="$context" \
22+
-f description="Waiting for /test-gpu command..."
23+
done
24+
env:
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-gpu.yml

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,18 @@ on:
66
types: [created]
77
push:
88
branches: [main]
9-
pull_request:
10-
types:
11-
- opened
12-
- synchronize
139
# Cancel the job if new commits are pushed
1410
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
1511
concurrency:
16-
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.issue.number || github.ref }}
12+
group: ${{ github.workflow }}-${{ github.event.issue.number || github.ref }}
1713
cancel-in-progress: true
1814
jobs:
19-
set-pending:
20-
name: GPU Tests Pending
21-
if: github.event_name == 'pull_request'
22-
runs-on: ubuntu-latest
23-
permissions:
24-
statuses: write
25-
steps:
26-
- name: Set pending status on PR
27-
run: |
28-
for context in "CI-Pass" "All Tests Green"; do
29-
gh api repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
30-
-f state=pending \
31-
-f context="$context" \
32-
-f description="Waiting for /test-gpu command..."
33-
done
34-
env:
35-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
3715
check:
3816
runs-on: ubuntu-latest
39-
# Skip pull_request (handled by set-pending) and issue_comment unless /test-gpu
17+
# Skip issue_comment unless it's /test-gpu on a PR
4018
if: >-
41-
github.event_name != 'pull_request' && (
42-
github.event_name != 'issue_comment' ||
43-
(github.event.issue.pull_request && startsWith(github.event.comment.body, '/test-gpu'))
44-
)
19+
github.event_name != 'issue_comment' ||
20+
(github.event.issue.pull_request && startsWith(github.event.comment.body, '/test-gpu'))
4521
outputs:
4622
head-sha: ${{ steps.get-sha.outputs.sha }}
4723
permissions:
@@ -218,7 +194,7 @@ jobs:
218194

219195
stable-dev-green:
220196
name: CI-Pass
221-
if: always() && github.event_name != 'pull_request'
197+
if: always()
222198
needs:
223199
- check
224200
- get-envs
@@ -255,7 +231,7 @@ jobs:
255231

256232
all-green:
257233
name: All Tests Green
258-
if: always() && github.event_name != 'pull_request'
234+
if: always()
259235
needs:
260236
- check
261237
- get-envs

0 commit comments

Comments
 (0)