-
Notifications
You must be signed in to change notification settings - Fork 11
87 lines (72 loc) · 2.89 KB
/
all_libs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: All libs
on:
workflow_call:
jobs:
pr-build:
name: Build and test
if: startsWith(github.ref, 'refs/heads/pull-request/')
strategy:
fail-fast: false
matrix:
platform: ['amd64', 'arm64']
runs-on: ${{ startsWith(github.repository, 'NVIDIA/cudaqx') && format('linux-{0}-cpu8', matrix.platform) || 'ubuntu-latest' }}
container: ghcr.io/nvidia/cuda-quantum-devdeps:ext-cu12.0-gcc11-main
permissions:
actions: write
contents: read
pull-requests: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
set-safe-directory: true
- name: Lookup PR info
id: get-pr-info
env:
GH_TOKEN: ${{ github.token }}
uses: nv-gha-runners/get-pr-info@main
- name: Export PR info
id: export-pr-info
run: |
echo "pr_number=${{ fromJSON(steps.get-pr-info.outputs.pr-info).number }}" >> $GITHUB_OUTPUT
# ========================================================================
# CUDA Quantum build
# ========================================================================
- name: Get required CUDAQ version
id: get-cudaq-version
uses: ./.github/actions/get-cudaq-version
- name: Get CUDAQ build
uses: ./.github/actions/get-cudaq-build
with:
repo: ${{ steps.get-cudaq-version.outputs.repo }}
ref: ${{ steps.get-cudaq-version.outputs.ref }}
token: ${{ secrets.CUDAQ_ACCESS_TOKEN }}
pr-number: ${{ steps.export-pr-info.outputs.pr_number }}
platform: ${{ matrix.platform }}
# ========================================================================
# Build
# ========================================================================
- name: Install build requirements
run: |
apt install -y --no-install-recommends gfortran libblas-dev libcusolver-dev-12-0
- name: Build
id: build
uses: ./.github/actions/build-lib
with:
lib: "all"
pr-number: ${{ steps.export-pr-info.outputs.pr_number }}
save-ccache: true
platform: ${{ matrix.platform }}
# ========================================================================
# Run tests
# ========================================================================
#
- name: Run tests
run: cmake --build ${{ steps.build.outputs.build-dir }} --target run_tests
# ========================================================================
# Run python tests
# ========================================================================
- name: Install python requirements
run: pip install numpy pytest cupy-cuda12x cuquantum-python-cu12
- name: Run Python tests
run: cmake --build ${{ steps.build.outputs.build-dir }} --target run_python_tests