forked from microsoft/Qcodes
-
Notifications
You must be signed in to change notification settings - Fork 2
106 lines (102 loc) · 3.26 KB
/
docs.yaml
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
name: build docs
on:
push:
branches:
- 'master'
- 'release/*'
- 'staging'
- 'trying'
tags:
- 'v*'
pull_request:
jobs:
builddocs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7, 3.9, "3.10"]
exclude:
- os: windows-latest
python-version: 3.9
- os: windows-latest
python-version: 3.10
- os: ubuntu-latest
python-version: 3.7
env:
DISPLAY: ':99.0'
OS: ${{ matrix.os }}
UPLOAD_TO_GHPAGES: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: '0'
# if we upload to ghpages we need the full
# history to generate correct version info
if: ${{ fromJSON(env.UPLOAD_TO_GHPAGES) }}
- uses: actions/[email protected]
if: ${{ !fromJSON(env.UPLOAD_TO_GHPAGES) }}
- name: setup ubuntu-latest xvfb
uses: ./.github/actions/setup-ubuntu-latest-xvfb
if: runner.os == 'Linux'
- name: install pandoc linux
run: sudo apt install pandoc
if: runner.os == 'Linux'
- name: Install pandoc on windows
uses: Wandalen/[email protected]
with:
action: crazy-max/[email protected]
with: |
args: install pandoc
attempt_limit: 5
attempt_delay: 1000
if: runner.os == 'Windows'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: prepare pip cache
id: prepare-cache-pip
uses: ./.github/actions/prepare-cache-pip
- name: pip cache
uses: actions/[email protected]
with:
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/docs_requirements.txt') }}-${{ hashFiles('**/setup.cfg') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: install requirements.txt
run: |
pip install -r requirements.txt
- name: install docs_requirements.txt
run: |
pip install -r docs_requirements.txt
- name: install qcodes
run: pip install .
- name: Build docs on linux
run: |
cd docs
export SPHINXOPTS="-W -v"
make html
if: runner.os == 'Linux'
- name: Build docs on windows
run: |
cd docs
$env:SPHINXOPTS = "-W -v"
./make.bat html
if: runner.os == 'Windows'
- name: Upload build docs
uses: actions/[email protected]
with:
name: docs_${{ matrix.python-version }}_${{ matrix.os }}
path: ${{ github.workspace }}/docs/_build/html
- name: Deploy to gh pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ${{ github.workspace }}/docs/_build/html
clean: true
single-commit: true
git-config-email: "bot"
git-config-name: "Documentation Bot"
if: ${{ fromJSON(env.UPLOAD_TO_GHPAGES) }}