Skip to content

CI Add commit status and comment bot to CUDA CI #29245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions .github/workflows/cuda-gpu-ci.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
name: CUDA GPU

# Only run this workflow when a Pull Request is labeled with the
# 'CUDA CI' label.
on:
workflow_dispatch:
inputs:
commit_hash:
description: Commit hash to test
required: true
pull_request:
types:
- labeled

permissions: read-all
# In order to remove the "CUDA CI" label we need to have write permissions for PRs
permissions:
pull-requests: write

jobs:
tests:
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
runs-on:
group: cuda-gpu-runner-group
name: Run Array API unit tests
steps:
- uses: actions-ecosystem/action-remove-labels@v1.3.0
with:
labels: CUDA CI
- uses: actions/setup-python@v5
with:
# XXX: The 3.12.4 release of Python on GitHub Actions is corrupted:
# https://github.com/actions/setup-python/issues/886
python-version: '3.12.3'
- uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_hash }}
- name: PRs associated with commit
run: |
echo "This commit belongs to PR(s):"
git ls-remote origin 'pull/*/head' | grep -F -f <(git rev-parse HEAD) | awk -F'/' '{print $3}'
- name: Checkout main repository
uses: actions/checkout@v4
- name: Cache conda environment
id: cache-conda
uses: actions/cache@v4
Expand All @@ -41,6 +43,7 @@ jobs:
conda activate sklearn
pip install --verbose --no-build-isolation --config-settings editable-verbose=true --editable .
- name: Run array API tests
id: tests
run: |
source "${HOME}/conda/etc/profile.d/conda.sh"
conda activate sklearn
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update-lock-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
schedule:
- cron: '0 5 * * 1'

# XXX Set the right permissions, per step??
# Can we set read only at the global level here and then elevate to write for some steps?
#permissions: read-all
# In order to add the "CUDA CI" label we need to have write permissions for PRs
permissions:
pull-requests: write

jobs:
update_lock_files:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run .github/workflows/cuda-gpu-ci.yml -f commit_hash=`git rev-parse HEAD`
gh pr edit ${{steps.cpr.outputs.pull-request-number}} --add-label "CUDA CI"

- name: Check Pull Request
if: steps.cpr.outputs.pull-request-number != ''
Expand Down
Loading