|
6 | 6 | types: [created] |
7 | 7 | push: |
8 | 8 | branches: [main] |
9 | | - pull_request: |
10 | | - types: |
11 | | - - opened |
12 | | - - synchronize |
13 | 9 | # Cancel the job if new commits are pushed |
14 | 10 | # https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre |
15 | 11 | 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 }} |
17 | 13 | cancel-in-progress: true |
18 | 14 | 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 | | - |
37 | 15 | check: |
38 | 16 | 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 |
40 | 18 | 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')) |
45 | 21 | outputs: |
46 | 22 | head-sha: ${{ steps.get-sha.outputs.sha }} |
47 | 23 | permissions: |
@@ -218,7 +194,7 @@ jobs: |
218 | 194 |
|
219 | 195 | stable-dev-green: |
220 | 196 | name: CI-Pass |
221 | | - if: always() && github.event_name != 'pull_request' |
| 197 | + if: always() |
222 | 198 | needs: |
223 | 199 | - check |
224 | 200 | - get-envs |
@@ -255,7 +231,7 @@ jobs: |
255 | 231 |
|
256 | 232 | all-green: |
257 | 233 | name: All Tests Green |
258 | | - if: always() && github.event_name != 'pull_request' |
| 234 | + if: always() |
259 | 235 | needs: |
260 | 236 | - check |
261 | 237 | - get-envs |
|
0 commit comments