-
Notifications
You must be signed in to change notification settings - Fork 71
160 lines (145 loc) · 4.79 KB
/
Copy pathnightly_tests.yaml
File metadata and controls
160 lines (145 loc) · 4.79 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Nightly tests
on:
schedule:
- cron: '30 5 * * *' # Runs at 5:30am UTC
workflow_dispatch:
jobs:
wheels:
name: Build and test wheels
uses: ./.github/workflows/build_wheels.yaml
with:
build_type: Release
cudaq_wheels: Custom
cache_key_suffix: nightly
secrets: inherit
resolve-cudaq-main:
name: Resolve CUDA-Q main
runs-on: ubuntu-latest
outputs:
repo: ${{ steps.resolve.outputs.repo }}
ref: ${{ steps.resolve.outputs.ref }}
steps:
- name: Resolve latest CUDA-Q commit
id: resolve
run: |
repo=NVIDIA/cuda-quantum
ref=$(git ls-remote "https://github.com/${repo}.git" refs/heads/main | awk '{print $1}')
if [[ -z "$ref" ]]; then
echo "Failed to resolve ${repo}@main"
exit 1
fi
echo "Using CUDA-Q source: ${repo}@${ref}"
echo "repo=$repo" >> $GITHUB_OUTPUT
echo "ref=$ref" >> $GITHUB_OUTPUT
shell: bash
build-cudaq-main:
name: Build CUDA-Q main
needs: resolve-cudaq-main
strategy:
fail-fast: false
matrix:
platform: ['amd64', 'arm64']
cuda_version: ['12.6', '13.0']
runs-on: ${{ startsWith(github.repository, 'NVIDIA/cudaqx') && format('linux-{0}-cpu32', matrix.platform) || 'ubuntu-latest' }}
container: ghcr.io/nvidia/cuda-quantum-devcontainer:${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc12-main
permissions:
actions: write
contents: read
steps:
- name: Get code
uses: actions/checkout@v4
with:
set-safe-directory: true
- name: Configure
id: config
run: |
cuda_major=$(echo ${{ matrix.cuda_version }} | cut -d . -f1)
echo "cuda_major=$cuda_major" >> $GITHUB_OUTPUT
- name: Get CUDAQ build
uses: ./.github/actions/get-cudaq-build
with:
repo: ${{ needs.resolve-cudaq-main.outputs.repo }}
ref: ${{ needs.resolve-cudaq-main.outputs.ref }}
token: ${{ secrets.CUDAQ_ACCESS_TOKEN }}
cache-key-suffix: nightly
save-build: true
save-ccache: false
platform: ${{ matrix.platform }}-cu${{ steps.config.outputs.cuda_major }}
cudaq-main-all-libs:
name: All libs against CUDA-Q main
needs: [resolve-cudaq-main, build-cudaq-main]
uses: ./.github/workflows/all_libs.yaml
with:
cudaq_repo: ${{ needs.resolve-cudaq-main.outputs.repo }}
cudaq_ref: ${{ needs.resolve-cudaq-main.outputs.ref }}
cache_key_suffix: nightly
secrets: inherit
cudaq-main-qec:
name: QEC against CUDA-Q main
needs: [resolve-cudaq-main, build-cudaq-main]
uses: ./.github/workflows/lib_qec.yaml
with:
cudaq_repo: ${{ needs.resolve-cudaq-main.outputs.repo }}
cudaq_ref: ${{ needs.resolve-cudaq-main.outputs.ref }}
cache_key_suffix: nightly
secrets: inherit
cudaq-main-solvers:
name: Solvers against CUDA-Q main
needs: [resolve-cudaq-main, build-cudaq-main]
uses: ./.github/workflows/lib_solvers.yaml
with:
cudaq_repo: ${{ needs.resolve-cudaq-main.outputs.repo }}
cudaq_ref: ${{ needs.resolve-cudaq-main.outputs.ref }}
cache_key_suffix: nightly
secrets: inherit
cudaq-main-docs:
name: Docs against CUDA-Q main
needs: [resolve-cudaq-main, build-cudaq-main]
uses: ./.github/workflows/docs.yaml
with:
cudaq_repo: ${{ needs.resolve-cudaq-main.outputs.repo }}
cudaq_ref: ${{ needs.resolve-cudaq-main.outputs.ref }}
cache_key_suffix: nightly
secrets: inherit
cudaq-main-wheels:
name: Wheels against CUDA-Q main
needs: [resolve-cudaq-main, build-cudaq-main]
uses: ./.github/workflows/build_wheels.yaml
with:
build_type: Release
cudaq_wheels: Custom
cache_key_suffix: nightly
cudaq_repo: ${{ needs.resolve-cudaq-main.outputs.repo }}
cudaq_ref: ${{ needs.resolve-cudaq-main.outputs.ref }}
secrets: inherit
cleanup-nightly-cache:
name: Clean up nightly cache
if: ${{ always() }}
needs:
- wheels
- resolve-cudaq-main
- build-cudaq-main
- cudaq-main-all-libs
- cudaq-main-qec
- cudaq-main-solvers
- cudaq-main-docs
- cudaq-main-wheels
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Delete nightly cache entries
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
# Fetch the list of cache keys
cache_keys=$(gh cache list --repo ${{ github.repository }} --limit 1000 | cut -f 2)
for key in $cache_keys
do
if [[ $key =~ -nightly$ ]]; then
gh cache delete $key --repo ${{ github.repository }}
echo "Deleted cache entry: $key"
fi
done