Skip to content

Commit

Permalink
fix upload-artifact race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed Jan 12, 2025
1 parent f47ac40 commit 82adef6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ jobs:
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
if-no-files-found: error
overwrite: 'true'

- name: Set up mini CTK
uses: ./.github/actions/fetch_ctk
Expand Down Expand Up @@ -170,16 +169,18 @@ jobs:
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
if-no-files-found: error
overwrite: 'true'

# overwrite: true has a race condition among parallel jobs, so we let job 0 do the work
- name: Build and check cuda-python wheel
if: ${{ strategy.job-index == 0 }}
run: |
pushd cuda_python
pip wheel -v --no-deps .
twine check *.whl
popd
- name: List the cuda-python artifacts directory
if: ${{ strategy.job-index == 0 }}
run: |
if [[ "${{ matrix.host-platform }}" == win* ]]; then
export CHOWN=chown
Expand All @@ -189,13 +190,13 @@ jobs:
$CHOWN -R $(whoami) cuda_python/*.whl
ls -lahR cuda_python
- name: Upload cuda.bindings build artifacts
- name: Upload cuda-python build artifacts
if: ${{ strategy.job-index == 0 }}
uses: actions/upload-artifact@v4
with:
name: cuda-python-wheel
path: cuda_python/*.whl
if-no-files-found: error
overwrite: 'true'

- name: Pass environment variables to the next runner
id: pass_env
Expand Down

0 comments on commit 82adef6

Please sign in to comment.