Skip to content
Open
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
44 changes: 43 additions & 1 deletion .github/workflows/test-sdist-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,35 @@ on:
cuda-version:
required: true
type: string
build-pathfinder:
required: false
default: true
type: boolean
build-bindings:
required: false
default: true
type: boolean
build-core:
required: false
default: true
type: boolean
build-python:
required: false
default: true
type: boolean

defaults:
run:
shell: bash --noprofile --norc -xeuo pipefail {0}

permissions:
actions: read # This is required for actions/download-artifact
contents: read # This is required for actions/checkout

jobs:
test-sdist:
name: Test sdist builds
if: ${{ inputs.build-pathfinder || inputs.build-bindings || inputs.build-core || inputs.build-python }}
timeout-minutes: 60
runs-on: linux-amd64-cpu8
steps:
Expand All @@ -43,16 +61,26 @@ jobs:

# Pure Python packages -- no CTK needed.
- name: Build cuda.pathfinder sdist and wheel-from-sdist
if: ${{ inputs.build-pathfinder }}
run: |
python -m build --sdist cuda_pathfinder/
pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz

- name: Build cuda-python sdist and wheel-from-sdist
if: ${{ inputs.build-python }}
run: |
python -m build --sdist cuda_python/
pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz

- name: Download cuda.pathfinder wheel
if: ${{ !inputs.build-pathfinder && (inputs.build-bindings || inputs.build-core) }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: cuda-pathfinder-wheel
path: cuda_pathfinder/dist

- name: Constrain builds to the local cuda.pathfinder wheel
if: ${{ inputs.build-bindings }}
run: |
pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
Expand All @@ -65,25 +93,29 @@ jobs:
# The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN
# are exposed by this action.
- name: Enable sccache
if: ${{ inputs.build-bindings || inputs.build-core }}
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # 0.0.10
with:
disable_annotations: 'true'

# xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867
- name: Adding additional GHA cache-related env vars
if: ${{ inputs.build-bindings || inputs.build-core }}
uses: actions/github-script@v9
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'])
core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL'])

- name: Setup proxy cache
if: ${{ inputs.build-bindings || inputs.build-core }}
uses: nv-gha-runners/setup-proxy-cache@main
continue-on-error: true
with:
enable-apt: true

- name: Set up mini CTK
if: ${{ inputs.build-bindings || inputs.build-core }}
uses: ./.github/actions/fetch_ctk
continue-on-error: false
with:
Expand All @@ -93,6 +125,7 @@ jobs:
# cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH
# (set by fetch_ctk) must be available for both sdist and wheel builds.
- name: Build cuda.bindings sdist and wheel-from-sdist
if: ${{ inputs.build-bindings }}
run: |
export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
export CC="sccache cc"
Expand All @@ -102,7 +135,15 @@ jobs:
python -m build --sdist cuda_bindings/
pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz

- name: Download cuda.bindings wheel
if: ${{ !inputs.build-bindings && inputs.build-core }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }}
path: cuda_bindings/dist

- name: Constrain cuda.core to the local cuda.bindings wheel
if: ${{ inputs.build-core }}
run: |
CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
Expand All @@ -123,6 +164,7 @@ jobs:
# wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via
# get_requires_for_build_wheel in build_hooks.py).
- name: Build cuda.core sdist and wheel-from-sdist
if: ${{ inputs.build-core }}
run: |
export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
Expand All @@ -134,5 +176,5 @@ jobs:
pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz

- name: Show sccache stats
if: always()
if: ${{ always() && (inputs.build-bindings || inputs.build-core) }}
run: sccache --show-stats
40 changes: 40 additions & 0 deletions .github/workflows/test-sdist-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,35 @@ on:
cuda-version:
required: true
type: string
build-pathfinder:
required: false
default: true
type: boolean
build-bindings:
required: false
default: true
type: boolean
build-core:
required: false
default: true
type: boolean
build-python:
required: false
default: true
type: boolean

defaults:
run:
shell: bash --noprofile --norc -xeuo pipefail {0}

permissions:
actions: read # This is required for actions/download-artifact
contents: read # This is required for actions/checkout

jobs:
test-sdist:
name: Test sdist builds
if: ${{ inputs.build-pathfinder || inputs.build-bindings || inputs.build-core || inputs.build-python }}
timeout-minutes: 60
runs-on: windows-2022
steps:
Expand All @@ -45,23 +63,34 @@ jobs:
python-version: "3.12"

- name: Set up MSVC
if: ${{ inputs.build-bindings || inputs.build-core }}
uses: step-security/msvc-dev-cmd@22c98154b708dbd743e6f27a933cf6ceba3305c4 # v1.13.1

- name: Install build tools
run: python -m pip install "pip>=25.3" build

# Pure Python packages -- no CTK needed.
- name: Build cuda.pathfinder sdist and wheel-from-sdist
if: ${{ inputs.build-pathfinder }}
run: |
python -m build --sdist cuda_pathfinder/
pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz

- name: Build cuda-python sdist and wheel-from-sdist
if: ${{ inputs.build-python }}
run: |
python -m build --sdist cuda_python/
pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz

- name: Download cuda.pathfinder wheel
if: ${{ !inputs.build-pathfinder && (inputs.build-bindings || inputs.build-core) }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: cuda-pathfinder-wheel
path: cuda_pathfinder/dist

- name: Constrain builds to the local cuda.pathfinder wheel
if: ${{ inputs.build-bindings }}
run: |
pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
Expand All @@ -74,6 +103,7 @@ jobs:
# smoke test, not a production build; see build-wheel.yml which also
# limits sccache to Linux).
- name: Set up mini CTK
if: ${{ inputs.build-bindings || inputs.build-core }}
uses: ./.github/actions/fetch_ctk
continue-on-error: false
with:
Expand All @@ -85,14 +115,23 @@ jobs:
# Constraint paths are passed as native Windows paths because the pip
# subprocesses run outside Git Bash.
- name: Build cuda.bindings sdist and wheel-from-sdist
if: ${{ inputs.build-bindings }}
run: |
export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
export PIP_BUILD_CONSTRAINT="$(cygpath -w "$(pwd)/wheel-constraints/cuda-bindings.txt")"
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
python -m build --sdist cuda_bindings/
pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz

- name: Download cuda.bindings wheel
if: ${{ !inputs.build-bindings && inputs.build-core }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }}
path: cuda_bindings/dist

- name: Constrain cuda.core to the local cuda.bindings wheel
if: ${{ inputs.build-core }}
run: |
CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
Expand All @@ -113,6 +152,7 @@ jobs:
# wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via
# get_requires_for_build_wheel in build_hooks.py).
- name: Build cuda.core sdist and wheel-from-sdist
if: ${{ inputs.build-core }}
run: |
export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
Expand Down
Loading