-
Notifications
You must be signed in to change notification settings - Fork 364
90 lines (90 loc) · 3.37 KB
/
docs.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
name: Docs and Tutorial
on:
push:
branches: [main, 'stable/*']
pull_request:
branches: [main, 'stable/*']
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
docs:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-docs-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-docs-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: |
set -e
pip install -U pip virtualenv wheel
pip install -U tox
sudo apt-get update
sudo apt-get install -y build-essential libopenblas-dev pandoc
shell: bash
- name: Run Docs Build
run: tox -edocs
- uses: actions/upload-artifact@v2
with:
name: html_docs
path: docs/_build/html
tutorials:
runs-on: ubuntu-latest
needs: [docs]
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-tutorials-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version}}-pip-tutorials-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}}-
- name: Setup tutorials job
run: |
set -e
git clone https://github.com/Qiskit/qiskit-tutorials --depth=1
python -m pip install --upgrade pip wheel
pip install -U -r requirements-dev.txt -c constraints.txt
pip install -c constraints.txt git+https://github.com/Qiskit/qiskit
pip install -c constraints.txt .
pip install -U "qiskit-ibmq-provider" "z3-solver" "qiskit-ignis" "qiskit-aqua" "pyscf<1.7.4" "matplotlib>=3.3.0" jupyter pylatexenc nbsphinx cvxpy qiskit-sphinx-theme -c constraints.txt
sudo apt install -y graphviz pandoc libopenblas-dev
pip check
shell: bash
- name: Run Tutorials
run: |
set -e
cd qiskit-tutorials
rm -rf tutorials/chemistry tutorials/circuits tutorials/circuits_advanced tutorials/finance tutorials/optimization tutorials/algorithms tutorials/operators tutorials/noise tutorials/machine_learning
sphinx-build -b html . _build/html
- uses: actions/upload-artifact@v2
with:
name: tutorials_html
path: qiskit-tutorials/_build/html