Skip to content

MAINT Protect CUDA GPU workflow against timed commits #29286

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

Merged
merged 2 commits into from
Jun 18, 2024
Merged
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
17 changes: 9 additions & 8 deletions .github/workflows/cuda-gpu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: CUDA GPU
on:
workflow_dispatch:
inputs:
pr_id:
description: Test the contents of this Pull Request
commit_hash:
description: Commit hash to test
required: true

permissions: read-all
Expand All @@ -19,12 +19,13 @@ jobs:
# 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'
- name: Checkout main repository
uses: actions/checkout@v4
- run: |
git fetch origin +refs/pull/${{ inputs.pr_id }}/head:pr-${{ inputs.pr_id }}
git checkout pr-${{ inputs.pr_id }}
echo "Checked out commit $(git rev-parse HEAD)"
- 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: Cache conda environment
id: cache-conda
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-lock-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run .github/workflows/cuda-gpu-ci.yml -f pr_id=${{steps.cpr.outputs.pull-request-number}}
gh workflow run .github/workflows/cuda-gpu-ci.yml -f commit_hash=`git rev-parse HEAD`

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