1111 cuda-version :
1212 required : true
1313 type : string
14+ build-pathfinder :
15+ default : true
16+ type : boolean
17+ build-bindings :
18+ default : true
19+ type : boolean
20+ build-core :
21+ default : true
22+ type : boolean
23+ build-python :
24+ default : true
25+ type : boolean
1426
1527defaults :
1628 run :
1729 shell : bash --noprofile --norc -xeuo pipefail {0}
1830
1931permissions :
32+ actions : read # This is required for actions/download-artifact
2033 contents : read # This is required for actions/checkout
2134
2235jobs :
2336 test-sdist :
2437 name : Test sdist builds
38+ if : ${{ inputs.build-pathfinder || inputs.build-bindings || inputs.build-core || inputs.build-python }}
2539 timeout-minutes : 60
2640 runs-on : linux-amd64-cpu8
2741 steps :
@@ -43,38 +57,51 @@ jobs:
4357
4458 # Pure Python packages -- no CTK needed.
4559 - name : Build cuda.pathfinder sdist and wheel-from-sdist
60+ if : ${{ inputs.build-pathfinder }}
4661 run : |
4762 python -m build --sdist cuda_pathfinder/
4863 pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz
4964
5065 - name : Build cuda-python sdist and wheel-from-sdist
66+ if : ${{ inputs.build-python }}
5167 run : |
5268 python -m build --sdist cuda_python/
5369 pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz
5470
71+ - name : Download cuda.pathfinder wheel
72+ if : ${{ !inputs.build-pathfinder && (inputs.build-bindings || inputs.build-core) }}
73+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
74+ with :
75+ name : cuda-pathfinder-wheel
76+ path : cuda_pathfinder/dist
77+
5578 # Cython packages need CTK + sccache.
5679 # The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN
5780 # are exposed by this action.
5881 - name : Enable sccache
82+ if : ${{ inputs.build-bindings || inputs.build-core }}
5983 uses : mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # 0.0.10
6084 with :
6185 disable_annotations : ' true'
6286
6387 # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867
6488 - name : Adding additional GHA cache-related env vars
89+ if : ${{ inputs.build-bindings || inputs.build-core }}
6590 uses : actions/github-script@v9
6691 with :
6792 script : |
6893 core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'])
6994 core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL'])
7095
7196 - name : Setup proxy cache
97+ if : ${{ inputs.build-bindings || inputs.build-core }}
7298 uses : nv-gha-runners/setup-proxy-cache@main
7399 continue-on-error : true
74100 with :
75101 enable-apt : true
76102
77103 - name : Set up mini CTK
104+ if : ${{ inputs.build-bindings || inputs.build-core }}
78105 uses : ./.github/actions/fetch_ctk
79106 continue-on-error : false
80107 with :
@@ -84,27 +111,38 @@ jobs:
84111 # cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH
85112 # (set by fetch_ctk) must be available for both sdist and wheel builds.
86113 - name : Build cuda.bindings sdist and wheel-from-sdist
114+ if : ${{ inputs.build-bindings }}
87115 run : |
88116 export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
89117 export CC="sccache cc"
90118 export CXX="sccache c++"
91119 export PIP_FIND_LINKS="$(pwd)/cuda_pathfinder/dist"
120+ export PIP_PRE=1
92121 python -m build --sdist cuda_bindings/
93122 pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz
94123
124+ - name : Download cuda.bindings wheel
125+ if : ${{ !inputs.build-bindings && inputs.build-core }}
126+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
127+ with :
128+ name : cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }}
129+ path : cuda_bindings/dist
130+
95131 # cuda_core sdist delegates to setuptools (no CTK needed), but
96132 # wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via
97133 # get_requires_for_build_wheel in build_hooks.py).
98134 - name : Build cuda.core sdist and wheel-from-sdist
135+ if : ${{ inputs.build-core }}
99136 run : |
100137 export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
101138 export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
102139 export CC="sccache cc"
103140 export CXX="sccache c++"
104141 export PIP_FIND_LINKS="$(pwd)/cuda_bindings/dist $(pwd)/cuda_pathfinder/dist"
142+ export PIP_PRE=1
105143 python -m build --sdist cuda_core/
106144 pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz
107145
108146 - name : Show sccache stats
109- if : always()
147+ if : ${{ always() && (inputs.build-bindings || inputs.build-core) }}
110148 run : sccache --show-stats
0 commit comments