11on :
2+ workflow_call :
3+ inputs :
4+ cache_base :
5+ required : false
6+ type : string
7+ default : main
8+ cudaq_version :
9+ required : false
10+ type : string
11+ description : ' Override version for wheel/installer (e.g. when called from deployments for a release).'
12+ default : ' '
213 # Daily rebuild on main to ensure devdeps rebuilt as needed
314 schedule :
415 - cron : ' 0 4 * * *' # aim to be ready by 9am CET/CEST
@@ -59,11 +70,16 @@ jobs:
5970
6071 - id : version
6172 run : |
62- is_versioned= ${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }}
63- if ${is_versioned}; then
64- cudaq_version=$(echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")
73+ if [ -n " ${{ inputs.cudaq_version }}" ]; then
74+ cudaq_version=$(echo "${{ inputs.cudaq_version }}" | egrep -o "([0-9]{1,}\.)+[0-9]{1,}([A-Za-z0-9_\-\.]*)" || true)
75+ cudaq_version=${cudaq_version:-0.0.0}
6576 else
66- cudaq_version=0.0.0
77+ is_versioned=${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }}
78+ if ${is_versioned}; then
79+ cudaq_version=$(echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")
80+ else
81+ cudaq_version=0.0.0
82+ fi
6783 fi
6884 echo "cudaq_version=$cudaq_version" >> $GITHUB_OUTPUT
6985
88104 name : Build & Test (arm64)
89105 needs : devdeps
90106 runs-on : macos-26
91- timeout-minutes : 180
92107 env :
108+ CC : clang
109+ CXX : clang++
93110 MACOSX_DEPLOYMENT_TARGET : ' 13.0'
94111
95112 steps :
@@ -127,8 +144,6 @@ jobs:
127144 - name : Build MLIR Python bindings
128145 run : |
129146 source scripts/set_env_defaults.sh
130-
131- # Incremental rebuild: add python-bindings to cached LLVM build
132147 Python3_EXECUTABLE="$(which python3)" \
133148 LLVM_PROJECTS='clang;lld;mlir;openmp;python-bindings' \
134149 LLVM_SOURCE="$HOME/.llvm-project" \
@@ -152,8 +167,9 @@ jobs:
152167 python_version : ['3.11', '3.12', '3.13']
153168 fail-fast : false
154169 runs-on : macos-26
155- timeout-minutes : 90
156170 env :
171+ CC : clang
172+ CXX : clang++
157173 MACOSX_DEPLOYMENT_TARGET : ' 13.0'
158174 outputs :
159175 cudaq_version : ${{ needs.metadata.outputs.cudaq_version }}
@@ -189,8 +205,6 @@ jobs:
189205 - name : Build MLIR Python bindings
190206 run : |
191207 source scripts/set_env_defaults.sh
192-
193- # Incremental rebuild: add python-bindings to cached LLVM build
194208 Python3_EXECUTABLE="$(which python3)" \
195209 LLVM_PROJECTS='clang;lld;mlir;openmp;python-bindings' \
196210 LLVM_SOURCE="$HOME/.llvm-project" \
@@ -216,7 +230,7 @@ jobs:
216230 # Consistent with Linux: pycudaq-<python_version_dashed>-<platform_info>
217231 name : pycudaq-${{ matrix.python_version }}-darwin-arm64
218232 path : dist/cuda_quantum*.whl
219- retention-days : 1
233+ retention-days : 3
220234 if-no-files-found : error
221235
222236 # ============================================================================
@@ -230,7 +244,6 @@ jobs:
230244 python_version : ['3.11', '3.12', '3.13']
231245 fail-fast : false
232246 runs-on : macos-26
233- timeout-minutes : 30
234247
235248 steps :
236249 - name : Checkout repository
@@ -268,8 +281,9 @@ jobs:
268281 name : Installer (arm64)
269282 needs : [devdeps, metadata]
270283 runs-on : macos-26
271- timeout-minutes : 120
272284 env :
285+ CC : clang
286+ CXX : clang++
273287 MACOSX_DEPLOYMENT_TARGET : ' 13.0'
274288 outputs :
275289 cudaq_version : ${{ needs.metadata.outputs.cudaq_version }}
@@ -307,8 +321,6 @@ jobs:
307321 - name : Build MLIR Python bindings
308322 run : |
309323 source scripts/set_env_defaults.sh
310-
311- # Incremental rebuild: add python-bindings to cached LLVM build
312324 Python3_EXECUTABLE="$(which python3)" \
313325 LLVM_PROJECTS='clang;lld;mlir;openmp;python-bindings' \
314326 LLVM_SOURCE="$HOME/.llvm-project" \
@@ -332,7 +344,7 @@ jobs:
332344 # Consistent with Linux: cudaq-<platform>-<config>-installer-<run_id>
333345 name : cudaq-arm64-darwin-installer-${{ github.run_id }}
334346 path : out/install_cuda_quantum*
335- retention-days : 1
347+ retention-days : 3
336348 if-no-files-found : error
337349
338350 # ============================================================================
@@ -343,7 +355,6 @@ jobs:
343355 name : Validate Installation (arm64)
344356 needs : [installer, wheel]
345357 runs-on : macos-26
346- timeout-minutes : 30
347358
348359 steps :
349360 - name : Checkout repository
@@ -366,16 +377,34 @@ jobs:
366377 name : pycudaq-3.12-darwin-arm64
367378 path : wheel/
368379
369- - name : Install CUDA-Q (C++ via installer)
380+ - name : Create test user
381+ run : |
382+ sudo sysadminctl -addUser cudaqtest -password 'cudaqtest123' -admin
383+ sudo mkdir -p /Users/cudaqtest
384+ sudo chown cudaqtest /Users/cudaqtest
385+
386+ - name : Install CUDA-Q (C++ via installer to neutral path)
370387 run : |
388+ install_path=/opt/cudaq-test
389+ sudo mkdir -p "$install_path"
390+ sudo chown cudaqtest "$install_path"
371391 chmod +x installer/install_cuda_quantum*
372- bash installer/install_cuda_quantum* --accept -- --installpath $HOME/.cudaq
392+ sudo -u cudaqtest bash installer/install_cuda_quantum* --accept -- --installpath "$install_path"
373393
374394 - name : Install CUDA-Q (Python via wheel)
375395 run : |
376- pip install wheel/*.whl
396+ sudo -u cudaqtest -H python3 -m venv /Users/cudaqtest/venv
397+ sudo -u cudaqtest -H /Users/cudaqtest/venv/bin/pip install wheel/*.whl
377398
378399 - name : Validate installation
379400 run : |
380- source $HOME/.zshrc
381- bash scripts/validate_installation.sh
401+ install_path=/opt/cudaq-test
402+ workdir=$(sudo -u cudaqtest mktemp -d)
403+ sudo cp -R scripts docs "$workdir/"
404+ sudo chown -R cudaqtest "$workdir"
405+ sudo -u cudaqtest bash -lc "
406+ source /Users/cudaqtest/venv/bin/activate
407+ source ${install_path}/set_env.sh
408+ cd ${workdir}
409+ bash scripts/validate_installation.sh
410+ "
0 commit comments