Skip to content

Commit c110dcf

Browse files
Copilotleofang
andcommitted
Consolidate GitHub CLI installation steps as requested in PR review
Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
1 parent ad5736b commit c110dcf

2 files changed

Lines changed: 25 additions & 33 deletions

File tree

.github/workflows/test-wheel-linux.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,10 @@ jobs:
149149
SHA: ${{ github.sha }}
150150
run: ./ci/tools/env-vars test
151151

152-
- name: Download cuda-pathfinder build artifacts from main branch
153-
env:
154-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152+
- name: Install GitHub CLI
153+
# gh is needed for artifact fetching in subsequent steps
155154
run: |
156155
# See https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt.
157-
# gh is needed for artifact fetching.
158156
mkdir -p -m 755 /etc/apt/keyrings \
159157
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
160158
&& cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
@@ -163,6 +161,10 @@ jobs:
163161
&& apt update \
164162
&& apt install gh -y
165163
164+
- name: Download cuda-pathfinder build artifacts from main branch
165+
env:
166+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167+
run: |
166168
MAIN_BRANCH="main"
167169
PATHFINDER_BASENAME="cuda-pathfinder-wheel"
168170
LATEST_MAIN_RUN_ID=$(gh run list -b ${MAIN_BRANCH} -L 1 -w "CI" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
@@ -196,16 +198,6 @@ jobs:
196198
env:
197199
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198200
run: |
199-
# See https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt.
200-
# gh is needed for artifact fetching.
201-
mkdir -p -m 755 /etc/apt/keyrings \
202-
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
203-
&& cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
204-
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
205-
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
206-
&& apt update \
207-
&& apt install gh -y
208-
209201
OLD_BRANCH=$(cat .github/BACKPORT_BRANCH)
210202
OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
211203
LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "build-and-test.yml" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')

.github/workflows/test-wheel-windows.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,6 @@ jobs:
117117
shell: bash --noprofile --norc -xeuo pipefail {0}
118118
run: ./ci/tools/env-vars test
119119

120-
- name: Download cuda-pathfinder build artifacts from main branch
121-
env:
122-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123-
run: |
124-
$MAIN_BRANCH = "main"
125-
$PATHFINDER_BASENAME = "cuda-pathfinder-wheel"
126-
$runData = gh run list -b $MAIN_BRANCH -L 1 -w "CI" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json
127-
if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) {
128-
Write-Host "LATEST_MAIN_RUN_ID not found!"
129-
exit 1
130-
}
131-
$LATEST_MAIN_RUN_ID = $runData[0].databaseId
132-
133-
gh run download $LATEST_MAIN_RUN_ID -p $PATHFINDER_BASENAME -R NVIDIA/cuda-python
134-
Get-ChildItem -Path $PATHFINDER_BASENAME
135-
New-Item -Path "./cuda_pathfinder" -ItemType Directory -Force
136-
Move-Item -Path "$PATHFINDER_BASENAME/*.whl" -Destination "./cuda_pathfinder/"
137-
Remove-Item -Path $PATHFINDER_BASENAME -Force
138-
139120
- name: Download cuda-python build artifacts
140121
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}}
141122
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
@@ -165,6 +146,25 @@ jobs:
165146
}
166147
gh --version
167148
149+
- name: Download cuda-pathfinder build artifacts from main branch
150+
env:
151+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152+
run: |
153+
$MAIN_BRANCH = "main"
154+
$PATHFINDER_BASENAME = "cuda-pathfinder-wheel"
155+
$runData = gh run list -b $MAIN_BRANCH -L 1 -w "CI" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json
156+
if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) {
157+
Write-Host "LATEST_MAIN_RUN_ID not found!"
158+
exit 1
159+
}
160+
$LATEST_MAIN_RUN_ID = $runData[0].databaseId
161+
162+
gh run download $LATEST_MAIN_RUN_ID -p $PATHFINDER_BASENAME -R NVIDIA/cuda-python
163+
Get-ChildItem -Path $PATHFINDER_BASENAME
164+
New-Item -Path "./cuda_pathfinder" -ItemType Directory -Force
165+
Move-Item -Path "$PATHFINDER_BASENAME/*.whl" -Destination "./cuda_pathfinder/"
166+
Remove-Item -Path $PATHFINDER_BASENAME -Force
167+
168168
- name: Install zstd
169169
# the GPU runner image does not have zstd pre-installed... and it's needed by actions/cache
170170
if: ${{ matrix.LOCAL_CTK == '1' }}

0 commit comments

Comments
 (0)