Skip to content

Commit

Permalink
update CI to build/test the meta wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed Jan 6, 2025
1 parent 45b1bfd commit 6be141f
Showing 1 changed file with 46 additions and 12 deletions.
58 changes: 46 additions & 12 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
# (matrix.host-platform == 'win-64' && 'windows-amd64-cpu8') }}
outputs:
BUILD_CTK_VER: ${{ steps.pass_env.outputs.CUDA_VERSION }}
default:
run:
shell: bash --noprofile --norc -xeuo pipefail {0}
steps:
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v4
Expand All @@ -62,7 +65,6 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1

- name: Set environment variables
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
Expand All @@ -82,7 +84,6 @@ jobs:
echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV

- name: Dump environment
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
env
Expand All @@ -97,7 +98,6 @@ jobs:
output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}

- name: List the cuda.core artifacts directory
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
if [[ "${{ matrix.host-platform }}" == win* ]]; then
export CHOWN=chown
Expand All @@ -108,7 +108,6 @@ jobs:
ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
- name: Check cuda.core wheel
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
pip install twine
twine check ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
Expand Down Expand Up @@ -146,7 +145,6 @@ jobs:
output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}

- name: List the cuda.bindings artifacts directory
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
if [[ "${{ matrix.host-platform }}" == win* ]]; then
export CHOWN=chown
Expand All @@ -158,7 +156,6 @@ jobs:
# TODO: enable this after NVIDIA/cuda-python#297 is resolved
# - name: Check cuda.bindings wheel
# shell: bash --noprofile --norc -xeuo pipefail {0}
# run: |
# twine check ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl

Expand All @@ -170,6 +167,31 @@ jobs:
if-no-files-found: error
overwrite: 'true'

- name: Build and check cuda-python wheel
run: |
pushd cuda_python
pip wheel -v --no-deps .
twine check *.whl
popd
- name: List the cuda-python artifacts directory
run: |
if [[ "${{ matrix.host-platform }}" == win* ]]; then
export CHOWN=chown
else
export CHOWN="sudo chown"
fi
$CHOWN -R $(whoami) cuda_python/*.whl
ls -lahR cuda_python
- name: Upload cuda.bindings build artifacts
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
run: |
Expand Down Expand Up @@ -221,9 +243,11 @@ jobs:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
needs:
- build
default:
run:
shell: bash --noprofile --norc -xeuo pipefail {0}
steps:
- name: Ensure GPU is working
shell: bash --noprofile --norc -xeuo pipefail {0}
run: nvidia-smi

- name: Checkout ${{ github.event.repository.name }}
Expand All @@ -232,7 +256,6 @@ jobs:
fetch-depth: 0

- name: Set environment variables
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
Expand All @@ -257,14 +280,24 @@ jobs:
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
echo "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" >> $GITHUB_ENV
- name: Download cuda-python build artifacts
uses: actions/download-artifact@v4
with:
name: cuda-python-wheel
path: .

- name: Display structure of downloaded cuda-python artifacts
run: |
pwd
ls -lahR .
- name: Download cuda.bindings build artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}

- name: Display structure of downloaded cuda.bindings artifacts
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
pwd
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
Expand All @@ -276,7 +309,6 @@ jobs:
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}

- name: Display structure of downloaded cuda.core build artifacts
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
pwd
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
Expand All @@ -295,7 +327,6 @@ jobs:

- name: Run cuda.bindings tests
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
ls $CUDA_PATH
Expand All @@ -311,7 +342,6 @@ jobs:
popd
- name: Run cuda.core tests
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
if [[ ${{ matrix.python-version }} == "3.13" ]]; then
# TODO: remove this hack once cuda-python has a cp313 build
Expand All @@ -333,6 +363,10 @@ jobs:
pytest -rxXs tests/
popd
- name: Ensure cuda-python installable
run: |
pip install cuda_python*.whl
doc:
name: Docs
# The build stage could fail but we want the CI to keep moving.
Expand Down

0 comments on commit 6be141f

Please sign in to comment.