Skip to content

Commit 82adef6

Browse files
committed
fix upload-artifact race condition
1 parent f47ac40 commit 82adef6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/build-and-test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ jobs:
123123
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
124124
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
125125
if-no-files-found: error
126-
overwrite: 'true'
127126

128127
- name: Set up mini CTK
129128
uses: ./.github/actions/fetch_ctk
@@ -170,16 +169,18 @@ jobs:
170169
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
171170
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
172171
if-no-files-found: error
173-
overwrite: 'true'
174172

173+
# overwrite: true has a race condition among parallel jobs, so we let job 0 do the work
175174
- name: Build and check cuda-python wheel
175+
if: ${{ strategy.job-index == 0 }}
176176
run: |
177177
pushd cuda_python
178178
pip wheel -v --no-deps .
179179
twine check *.whl
180180
popd
181181
182182
- name: List the cuda-python artifacts directory
183+
if: ${{ strategy.job-index == 0 }}
183184
run: |
184185
if [[ "${{ matrix.host-platform }}" == win* ]]; then
185186
export CHOWN=chown
@@ -189,13 +190,13 @@ jobs:
189190
$CHOWN -R $(whoami) cuda_python/*.whl
190191
ls -lahR cuda_python
191192
192-
- name: Upload cuda.bindings build artifacts
193+
- name: Upload cuda-python build artifacts
194+
if: ${{ strategy.job-index == 0 }}
193195
uses: actions/upload-artifact@v4
194196
with:
195197
name: cuda-python-wheel
196198
path: cuda_python/*.whl
197199
if-no-files-found: error
198-
overwrite: 'true'
199200

200201
- name: Pass environment variables to the next runner
201202
id: pass_env

0 commit comments

Comments
 (0)