Skip to content

Commit 1808cef

Browse files
authored
Add wheel build and test to CI PR checks (#581)
Adds a build and test of our Python wheels when relevant files are changed. This will make the CI slower for those PRs (current full PR CI takes ~45 minutes, versus the wheel build takes 1 hour 15 minutes on average, with some recent builds taking closer to 2 hours). Adds wheel build to PRs that change: - `.cudaq_version` - Wheel workflow, action, build script, or validation logic - Wheel package dependency/metadata files - Python metapackage build logic or package definitions Signed-off-by: Angela Burton <angelab@nvidia.com>
1 parent f92dc31 commit 1808cef

2 files changed

Lines changed: 40 additions & 3 deletions

File tree

.github/workflows/build_wheels.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,14 @@ on:
6161
type: string
6262
default: ''
6363
required: false
64+
secrets:
65+
CUDAQ_ACCESS_TOKEN:
66+
required: false
67+
WORKFLOW_TOKEN:
68+
required: false
6469

6570
concurrency:
66-
group: ${{ github.workflow }}-${{ github.ref }}
71+
group: ${{ github.workflow }}-build-wheels-${{ github.ref }}
6772
cancel-in-progress: true
6873

6974
jobs:
@@ -78,7 +83,9 @@ jobs:
7883
container:
7984
image: ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc12-main
8085
options: --ulimit nofile=1048576:1048576
81-
permissions: write-all
86+
permissions:
87+
actions: write
88+
contents: read
8289
strategy:
8390
fail-fast: false
8491
matrix:

.github/workflows/pr_workflow.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
build-solvers: ${{ steps.filter.outputs.build-solvers }}
2222
build-examples-qec: ${{ steps.filter.outputs.build-examples-qec }}
2323
build-examples-solvers: ${{ steps.filter.outputs.build-examples-solvers }}
24+
build-wheels: ${{ steps.filter.outputs.build-wheels }}
2425
steps:
2526
- name: Checkout repository
2627
uses: actions/checkout@v4
@@ -42,7 +43,6 @@ jobs:
4243
build-cudaq:
4344
- '.github/actions/get-cudaq-build/**'
4445
- '.github/actions/get-cudaq-version/**'
45-
- '.github/workflows/scripts/build_cudaq.sh'
4646
- '.cudaq_version'
4747
build-docs:
4848
- '.github/workflows/docs.yaml'
@@ -90,6 +90,21 @@ jobs:
9090
- 'docs/sphinx/examples/qec/**'
9191
build-examples-solvers:
9292
- 'docs/sphinx/examples/solvers/**'
93+
build-wheels:
94+
- '.github/actions/get-cudaq-wheels/**'
95+
- '.github/workflows/build_wheels.yaml'
96+
- '.github/workflows/scripts/build_cudaq.sh'
97+
- '.github/workflows/scripts/build_wheels.sh'
98+
- 'scripts/ci/build_metapackages.sh'
99+
- 'scripts/ci/test_wheels.sh'
100+
- 'libs/qec/pyproject.toml.cu*'
101+
- 'libs/qec/python/metapackages/MANIFEST.in'
102+
- 'libs/qec/python/metapackages/pyproject.toml'
103+
- 'libs/qec/python/metapackages/setup.py'
104+
- 'libs/solvers/pyproject.toml.cu*'
105+
- 'libs/solvers/python/metapackages/MANIFEST.in'
106+
- 'libs/solvers/python/metapackages/pyproject.toml'
107+
- '.cudaq_version'
93108
94109
build-cudaq:
95110
name: Build CUDAQ
@@ -179,6 +194,19 @@ jobs:
179194
)
180195
uses: ./.github/workflows/lib_solvers.yaml
181196

197+
build-wheels:
198+
name: Wheels
199+
needs: [check-changes]
200+
if: |
201+
!failure() && !cancelled() &&
202+
needs.check-changes.outputs.build-wheels == 'true'
203+
uses: ./.github/workflows/build_wheels.yaml
204+
with:
205+
build_type: Release
206+
cudaq_wheels: Custom
207+
secrets:
208+
CUDAQ_ACCESS_TOKEN: ${{ secrets.CUDAQ_ACCESS_TOKEN }}
209+
182210
# This job is used for branch protection checks.
183211
verify:
184212
name: Verify PR
@@ -188,6 +216,7 @@ jobs:
188216
- build-all
189217
- build-qec
190218
- build-solvers
219+
- build-wheels
191220
runs-on: ubuntu-latest
192221
steps:
193222
- name: Check results
@@ -210,6 +239,7 @@ jobs:
210239
check_result "build-all" "${{needs.build-all.result}}"
211240
check_result "build-qec" "${{needs.build-qec.result}}"
212241
check_result "build-solvers" "${{needs.build-solvers.result}}"
242+
check_result "build-wheels" "${{needs.build-wheels.result}}"
213243
214244
if [[ "$status" != "success" ]]; then
215245
exit 1

0 commit comments

Comments
 (0)