-
Notifications
You must be signed in to change notification settings - Fork 184
93 lines (85 loc) · 3.5 KB
/
integration_tests.yml
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
name: Nightly integration tests
# Run on request and every day at 3 AM UTC
on:
workflow_dispatch:
inputs:
syntax_check:
type: boolean
required: true
description: 'Run syntax checker (Quantinuum).'
target:
description: 'Target'
required: true
default: 'none'
type: choice
options:
- none
- ionq
- quantinuum
target_machine:
type: string
required: false
description: 'Target machine (e.g., H1-1E).'
schedule:
- cron: 0 3 * * *
jobs:
integration_test:
name: Intergration test
runs-on: ubuntu-latest
environment: backend-validation
container:
image: ghcr.io/nvidia/cuda-quantum:latest-hpc
options: --user root
steps:
- name: Get commit SHA
id: commit-sha
run: |
echo "sha=$(cat $CUDA_QUANTUM_PATH/assets/build_info.txt | grep -o 'source-sha: \S*' | cut -d ' ' -f 2)" >> $GITHUB_OUTPUT
- name: Get code
uses: actions/checkout@v3
with:
ref: ${{ steps.commit-sha.outputs.sha }}
fetch-depth: 1
- name: Setup quantinum account
if: github.event_name == 'schedule' || inputs.syntax_check || inputs.target == 'quantinuum'
run: |
curl -X POST -H "Content Type: application/json" -d '{ "email":"${{ secrets.BACKEND_LOGIN_EMAIL }}","password":"${{ secrets.QUANTINUUM_PASSWORD }}" }' https://qapi.quantinuum.com/v1/login > credentials.json
id_token=`cat credentials.json | jq -r '."id-token"'`
refresh_token=`cat credentials.json | jq -r '."refresh-token"'`
echo "key: $id_token" > ~/.quantinuum_config
echo "refresh: $refresh_token" >> ~/.quantinuum_config
- name: QIR syntax check (Quantinuum)
if: inputs.syntax_check || github.event_name == 'schedule'
run: |
for filename in test/NVQPP/integration/*.cpp; do
[ -e "$filename" ] || echo "::error::Couldn't find files ($filename)"
nvq++ -v $filename -DSYNTAX_CHECK --target quantinuum --quantinuum-machine H1-1SC
CUDAQ_LOG_LEVEL=info ./a.out
done
shell: bash
- name: Submit to IonQ Simulator
if: inputs.target == 'ionq' || github.event_name == 'schedule'
run: |
export IONQ_API_KEY="${{ secrets.IONQ_API_KEY }}"
# TODO: remove this flag once https://github.com/NVIDIA/cuda-quantum/issues/512 is addressed.
export IONQ_FLAG="-DIONQ_TARGET"
for filename in test/NVQPP/integration/*.cpp; do
[ -e "$filename" ] || echo "::error::Couldn't find files ($filename)"
nvq++ -v $IONQ_FLAG $filename --target ionq
CUDAQ_LOG_LEVEL=info ./a.out
done
shell: bash
- name: Submit to ${{ inputs.target }}
if: inputs.target != 'none' && github.event_name == 'workflow_dispatch'
run: |
if ${{inputs.target == 'ionq'}}; then
export IONQ_API_KEY="${{ secrets.IONQ_API_KEY }}"
# TODO: remove this flag once https://github.com/NVIDIA/cuda-quantum/issues/512 is addressed.
export IONQ_FLAG="-DIONQ_TARGET"
fi
for filename in test/NVQPP/integration/*.cpp; do
[ -e "$filename" ] || echo "::error::Couldn't find files ($filename)"
nvq++ -v $IONQ_FLAG $filename --target ${{ inputs.target }} --${{ inputs.target }}-machine ${{ inputs.target_machine }}
CUDAQ_LOG_LEVEL=info ./a.out
done
shell: bash