-
Notifications
You must be signed in to change notification settings - Fork 60
117 lines (108 loc) · 3.99 KB
/
test_main_linux.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: test_main
# Controls when the workflow will run
on:
pull_request:
branches:
- main
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.8', '3.9', '3.10']
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Log in with Azure
uses: azure/login@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
- name: Install OpenQAOA
run: |
python -m pip install --user virtualenv
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
make dev-install-tests
pip install ipykernel
- name: Setup IBMQ account
env:
IBMQ_TOKEN: ${{ secrets.IBMQ_TOKEN }}
run: |
IBMQ_TOKEN=$IBMQ_TOKEN
source env/bin/activate
python -c'from qiskit_ibm_provider import IBMProvider; import os; IBMProvider.save_account(os.environ.get("IBMQ_TOKEN"))'
- name: Setup AWS
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
run: |
python -m pip install awscli
aws configure set aws_access_key_id $AWS_ACCESS_KEY
aws configure set aws_secret_access_key $AWS_SECRET_KEY
aws configure set region us-west-1
aws configure set output json
- name: Build the docker stack
run: |
docker login -u AWS -p $(aws ecr get-login-password --region us-east-1) 292282985366.dkr.ecr.us-east-1.amazonaws.com
docker network create local_bridge
docker build -t amazon-braket-oq-dev .
docker-compose up -d
- name: Run tests
run: |
source env/bin/activate
ipython kernel install --name "env" --user
pytest tests/ src/openqaoa-core/tests src/openqaoa-azure/tests src/openqaoa-braket/tests src/openqaoa-qiskit/tests -m 'not (qpu or sim)' --cov --cov-report=xml:coverage.xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./coverage.xml
docs:
runs-on: ubuntu-latest
steps:
- name: Check out openqaoa
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install OpenQAOA
run: |
python -m pip install --upgrade pip
make dev-install-docs
- name: Install qvm
run: |
find /usr/lib -name "libffi.so*"
sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so /usr/lib/x86_64-linux-gnu/libffi.so.6
wget -q https://downloads.rigetti.com/qcs-sdk/forest-sdk-2.23.0-linux-deb.tar.bz2
tar -xf forest-sdk-2.23.0-linux-deb.tar.bz2
cd forest-sdk-2.23.0-linux-deb/
sudo apt-get update
sudo apt-get install -y screen libblas-dev libblas3 libgfortran5 liblapack-dev liblapack3
sudo ./forest-sdk-2.23.0-linux-deb.run
qvm --version
quilc --version
echo "Starting qvm and quilc"
screen -d -m qvm -S
screen -d -m quilc -S
cd ..
- name: Build and test Sphinx docs
run: |
sudo apt-get install pandoc
cd docs/
make html