summaryrefslogtreecommitdiff
path: root/.github/workflows/docs.yml
blob: 0a26da8ad47c5ef875a6df1633a1b9a49a5d8825 (plain)
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
name: Documentation Build

on: [push, pull_request]

jobs:
  docbuild:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 100

      - name: Get tags
        run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

      - name: Set up minimal Python version
        uses: actions/setup-python@v2
        with:
          python-version: 3.9

      - name: Get pip cache dir
        id: pip-cache
        run: echo "::set-output name=dir::$(pip cache dir)"

      - name: Setup pip cache
        uses: actions/cache@v2
        with:
          path: ${{ steps.pip-cache.outputs.dir }}
          key: pip-docs
          restore-keys: pip-docs

      - name: Install dependencies
        run: |
          sudo apt install -y pandoc
          pip install --upgrade pip setuptools wheel
          pip install -r "requirements_docs.txt"
          pip install docutils==0.14 commonmark==0.8.1 recommonmark==0.5.0 babel==2.8
          pip install .

      - name: Build documentation
        run: sphinx-build -n -j auto -b html -d build/doctrees docs build/html

      - name: Doc Tests
        run: sphinx-build -a -j auto -b doctest -d build/doctrees docs build/doctest