Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Commit 72099b9

Browse files
authored
Set up CI with Azure Pipelines (#894)
* Set up CI with Azure Pipelines This commit adds the CI configuration for running sphinx builds in CI. [skip ci] * Add missing dep and start caching pip * Install pandoc and graphviz * Add cvxpy install for aer noise transformations * Move aqua tutorials that depend on CPLEX to legacy_tutorials There are 2 aqua tutorials that do not work unless CPLEX is installed. CPLEX is too involved and difficult to install in CI. It is also proprietary software which prohibits installing it in CI (since a CI system can't agree to the license terms). Honestly, I'm not entirely sure why aqua has modules in it that depend solely on having proprietary software installed, it feels like there should be an open alternative or if there is one already the tutorial should leverage that. To make the docs buildable this commit moves these problematic tutorials to the legacy directory so they're not built/run by default. * Workaround terra mpl drawer bug There is a bug in the mpl drawer in 0.19.0 (and 0.19.1) release where a custom instruction does not draw without a label parameter set. This will need to be fixed in terra, but in the meantime this worksaround the bug by manually setting a label. * Add texlive to installed packages * Install correct texlive metapackage with qcircuit * Correct package name again * Add another missing binary dep * Update qcircuit version as packaged version is too old * Try using tlmgr instead of manually downloading qcircuit * Try using more from tlmgr instead of apt * Fix typo * Use bash directly * Adjust texlive update script usage * Give up on tlmgr and try to manual install qcircuit again * Fix typo * revert aqua tutorial move and remove latex install * Remove section of aqua notebook 2 that requires cplex * Remove another notebook with cplex
1 parent 6136aba commit 72099b9

4 files changed

Lines changed: 62 additions & 880 deletions

File tree

azure-pipelines.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
trigger:
2+
branches:
3+
include:
4+
- master
5+
- stable/*
6+
pr:
7+
autoCancel: true
8+
branches:
9+
include:
10+
- '*'
11+
12+
pool:
13+
vmImage: 'ubuntu-latest'
14+
strategy:
15+
matrix:
16+
Python38:
17+
python.version: '3.8'
18+
variables:
19+
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
20+
steps:
21+
- task: UsePythonVersion@0
22+
inputs:
23+
versionSpec: '$(python.version)'
24+
displayName: 'Use Python $(python.version)'
25+
- task: Cache@2
26+
inputs:
27+
key: 'pip | "$(Agent.OS)" | "$(python.version)" | "$(Build.BuildNumber)"'
28+
restoreKeys: |
29+
pip | "$(Agent.OS)" | "$(python.version)"
30+
pip | "$(Agent.OS)"
31+
pip
32+
path: $(PIP_CACHE_DIR)
33+
displayName: Cache pip
34+
- bash: |
35+
set -e
36+
python -m pip install --upgrade pip setuptools wheel virtualenv
37+
virtualenv /tmp/docs_build
38+
source /tmp/docs_build/bin/activate
39+
pip install -U qiskit jupyter sphinx nbsphinx sphinx_rtd_theme
40+
pip install -U qiskit-terra[visualization] cvxpy
41+
sudo apt-get install -y pandoc graphviz
42+
displayName: 'Install dependencies'
43+
- bash: |
44+
set -e
45+
source /tmp/docs_build/bin/activate
46+
sphinx-build -b html . _build/html
47+
displayName: 'Build Docs'
48+
- task: ArchiveFiles@2
49+
inputs:
50+
rootFolderOrFile: '_build/html'
51+
archiveType: tar
52+
archiveFile: '$(Build.ArtifactStagingDirectory)/html_docs.tar.gz'
53+
verbose: true
54+
- task: PublishBuildArtifacts@1
55+
displayName: 'Publish docs'
56+
inputs:
57+
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
58+
artifactName: 'html_docs'
59+
Parallel: true
60+
ParallelCount: 8

0 commit comments

Comments
 (0)