diff --git a/.github/workflows/test-sdist-linux.yml b/.github/workflows/test-sdist-linux.yml index 42262a8aa29..f0f64492f2d 100644 --- a/.github/workflows/test-sdist-linux.yml +++ b/.github/workflows/test-sdist-linux.yml @@ -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: @@ -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 @@ -65,12 +93,14 @@ 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: | @@ -78,12 +108,14 @@ jobs: 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: @@ -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" @@ -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) @@ -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)" @@ -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 diff --git a/.github/workflows/test-sdist-windows.yml b/.github/workflows/test-sdist-windows.yml index eb4e25b5fc5..5451d20429e 100644 --- a/.github/workflows/test-sdist-windows.yml +++ b/.github/workflows/test-sdist-windows.yml @@ -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: @@ -45,6 +63,7 @@ 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 @@ -52,16 +71,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 @@ -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: @@ -85,6 +115,7 @@ 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")" @@ -92,7 +123,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) @@ -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)"