1111 cuda-version :
1212 required : true
1313 type : string
14+ build-pathfinder :
15+ required : false
16+ default : true
17+ type : boolean
18+ build-bindings :
19+ required : false
20+ default : true
21+ type : boolean
22+ build-core :
23+ required : false
24+ default : true
25+ type : boolean
26+ build-python :
27+ required : false
28+ default : true
29+ type : boolean
1430
1531defaults :
1632 run :
1733 shell : bash --noprofile --norc -xeuo pipefail {0}
1834
1935permissions :
36+ actions : read # This is required for actions/download-artifact
2037 contents : read # This is required for actions/checkout
2138
2239jobs :
2340 test-sdist :
2441 name : Test sdist builds
42+ if : ${{ inputs.build-pathfinder || inputs.build-bindings || inputs.build-core || inputs.build-python }}
2543 timeout-minutes : 60
2644 runs-on : linux-amd64-cpu8
2745 steps :
@@ -43,16 +61,26 @@ jobs:
4361
4462 # Pure Python packages -- no CTK needed.
4563 - name : Build cuda.pathfinder sdist and wheel-from-sdist
64+ if : ${{ inputs.build-pathfinder }}
4665 run : |
4766 python -m build --sdist cuda_pathfinder/
4867 pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz
4968
5069 - name : Build cuda-python sdist and wheel-from-sdist
70+ if : ${{ inputs.build-python }}
5171 run : |
5272 python -m build --sdist cuda_python/
5373 pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz
5474
75+ - name : Download cuda.pathfinder wheel
76+ if : ${{ !inputs.build-pathfinder && (inputs.build-bindings || inputs.build-core) }}
77+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
78+ with :
79+ name : cuda-pathfinder-wheel
80+ path : cuda_pathfinder/dist
81+
5582 - name : Constrain builds to the local cuda.pathfinder wheel
83+ if : ${{ inputs.build-bindings }}
5684 run : |
5785 pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
5886 test "${#pathfinder_wheels[@]}" -eq 1
@@ -65,25 +93,29 @@ jobs:
6593 # The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN
6694 # are exposed by this action.
6795 - name : Enable sccache
96+ if : ${{ inputs.build-bindings || inputs.build-core }}
6897 uses : mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # 0.0.10
6998 with :
7099 disable_annotations : ' true'
71100
72101 # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867
73102 - name : Adding additional GHA cache-related env vars
103+ if : ${{ inputs.build-bindings || inputs.build-core }}
74104 uses : actions/github-script@v9
75105 with :
76106 script : |
77107 core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'])
78108 core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL'])
79109
80110 - name : Setup proxy cache
111+ if : ${{ inputs.build-bindings || inputs.build-core }}
81112 uses : nv-gha-runners/setup-proxy-cache@main
82113 continue-on-error : true
83114 with :
84115 enable-apt : true
85116
86117 - name : Set up mini CTK
118+ if : ${{ inputs.build-bindings || inputs.build-core }}
87119 uses : ./.github/actions/fetch_ctk
88120 continue-on-error : false
89121 with :
93125 # cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH
94126 # (set by fetch_ctk) must be available for both sdist and wheel builds.
95127 - name : Build cuda.bindings sdist and wheel-from-sdist
128+ if : ${{ inputs.build-bindings }}
96129 run : |
97130 export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
98131 export CC="sccache cc"
@@ -102,7 +135,15 @@ jobs:
102135 python -m build --sdist cuda_bindings/
103136 pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz
104137
138+ - name : Download cuda.bindings wheel
139+ if : ${{ !inputs.build-bindings && inputs.build-core }}
140+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
141+ with :
142+ name : cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }}
143+ path : cuda_bindings/dist
144+
105145 - name : Constrain cuda.core to the local cuda.bindings wheel
146+ if : ${{ inputs.build-core }}
106147 run : |
107148 CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
108149 pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
@@ -123,6 +164,7 @@ jobs:
123164 # wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via
124165 # get_requires_for_build_wheel in build_hooks.py).
125166 - name : Build cuda.core sdist and wheel-from-sdist
167+ if : ${{ inputs.build-core }}
126168 run : |
127169 export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
128170 export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
@@ -134,5 +176,5 @@ jobs:
134176 pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz
135177
136178 - name : Show sccache stats
137- if : always()
179+ if : ${{ always() && (inputs.build-bindings || inputs.build-core) }}
138180 run : sccache --show-stats
0 commit comments