Ver código fonte

CI: add docs build

The docs are built-in read-the-docs (where the badge is also from) thus this is mostly useful for pull requests ensuring the docs get built.
Mikael Koli 4 anos atrás
pai
commit
62e660b30c
1 arquivos alterados com 40 adições e 0 exclusões
  1. 40 0
      .github/workflows/docs.yml

+ 40 - 0
.github/workflows/docs.yml

@@ -0,0 +1,40 @@
+name: docs
+
+# Controls when the workflow will run
+on:
+  # Triggers the workflow on push or pull request events but only for the master branch
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+jobs:
+  build-docs:
+    runs-on: ubuntu-latest
+    timeout-minutes: 5
+
+    strategy:
+      matrix:
+        python-version: [3.10.x]
+    steps:
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v2
+
+      - name: Setup Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python }}
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          python -m pip install -r requirements/docs.txt
+          python -m pip install -e .
+
+      - name: Build docs and run doctests
+        run: |
+          sphinx-build docs "docs/_build/html" --color -W -bhtml
+          sphinx-build -b doctest docs "docs/_build/html"