File tree Expand file tree Collapse file tree 2 files changed +22
-17
lines changed Expand file tree Collapse file tree 2 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 1
1
name : CUDA GPU
2
+
3
+ # Only run this workflow when a Pull Request is labeled with the
4
+ # 'CUDA CI' label.
2
5
on :
3
- workflow_dispatch :
4
- inputs :
5
- commit_hash :
6
- description : Commit hash to test
7
- required : true
6
+ pull_request :
7
+ types :
8
+ - labeled
8
9
9
- permissions : read-all
10
+ # In order to remove the "CUDA CI" label we need to have write permissions for PRs
11
+ permissions :
12
+ pull-requests : write
10
13
11
14
jobs :
12
15
tests :
16
+ if : contains(github.event.pull_request.labels.*.name, 'CUDA CI')
13
17
runs-on :
14
18
group : cuda-gpu-runner-group
19
+ # Set this high enough so that the tests can comforatble run. We set a
20
+ # timeout to make abusing this workflow less attractive.
21
+ timeout-minutes : 20
15
22
name : Run Array API unit tests
16
23
steps :
24
+ - uses : actions-ecosystem/action-remove-labels@v1
25
+ with :
26
+ labels : CUDA CI
17
27
- uses : actions/setup-python@v5
18
28
with :
19
29
# XXX: The 3.12.4 release of Python on GitHub Actions is corrupted:
20
30
# https://github.com/actions/setup-python/issues/886
21
31
python-version : ' 3.12.3'
22
- - uses : actions/checkout@v4
23
- with :
24
- ref : ${{ inputs.commit_hash }}
25
- - name : PRs associated with commit
26
- run : |
27
- echo "This commit belongs to PR(s):"
28
- git ls-remote origin 'pull/*/head' | grep -F -f <(git rev-parse HEAD) | awk -F'/' '{print $3}'
32
+ - name : Checkout main repository
33
+ uses : actions/checkout@v4
29
34
- name : Cache conda environment
30
35
id : cache-conda
31
36
uses : actions/cache@v4
Original file line number Diff line number Diff line change 6
6
schedule :
7
7
- cron : ' 0 5 * * 1'
8
8
9
- # XXX Set the right permissions, per step??
10
- # Can we set read only at the global level here and then elevate to write for some steps?
11
- # permissions: read-all
9
+ # In order to add the "CUDA CI" label we need to have write permissions for PRs
10
+ permissions :
11
+ pull-requests : write
12
12
13
13
jobs :
14
14
update_lock_files :
68
68
env :
69
69
GH_TOKEN : ${{ github.token }}
70
70
run : |
71
- gh workflow run .github/workflows/cuda-gpu-ci.yml -f commit_hash=`git rev-parse HEAD`
71
+ gh pr edit ${{steps.cpr.outputs.pull-request-number}} --add-label "CUDA CI"
72
72
73
73
- name : Check Pull Request
74
74
if : steps.cpr.outputs.pull-request-number != ''
You can’t perform that action at this time.
0 commit comments