-
Notifications
You must be signed in to change notification settings - Fork 60
114 lines (107 loc) · 4.05 KB
/
test_dev.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
name: test_dev
# Controls when the workflow will run
on:
pull_request:
branches:
- dev
# Manual trigger
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-dev:
runs-on: ubuntu-latest
if : ${{ github.event.pull_request.head.repo.fork == false }} # runs only when fork==false
# Steps represent a sequence of tasks that will be executed as part of the job
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: 3.9
- 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-cplex
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/*/tests -m 'not (qpu or sim)' --cov -n auto
- 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
if : github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false
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.9
- 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
mkdir ./docs/source/notebooks
cp ./examples/*.ipynb ./docs/source/notebooks/
cd docs/
make html SPHINXOPTS="-W --keep-going"