summaryrefslogtreecommitdiff
path: root/.github/workflows/docs.yml
blob: d648e8b5fb30c7687e56c81dc05f4a1dcd49cb70 (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
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
name: Docs

on:
  pull_request:
    paths:
      - 'docs/**'
      - '.github/workflows/docs.yml'
  push:
    branches:
      - main
    paths:
      - 'docs/**'
      - '.github/workflows/docs.yml'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  docs:
    runs-on: ubuntu-24.04
    name: spelling
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.13'
          cache: 'pip'
          cache-dependency-path: 'docs/requirements.txt'
      - run: python -m pip install -r docs/requirements.txt
      - name: Build docs
        run: |
          cd docs
          sphinx-build -b spelling -n -q -W -d _build/doctrees -D language=en_US -j auto . _build/spelling

  blacken-docs:
    runs-on: ubuntu-latest
    name: blacken-docs
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.13'
      - run: python -m pip install blacken-docs
      - name: Build docs
        run: |
          cd docs
          make black
          RESULT=`cat _build/black/output.txt`
          if [ "$RESULT" -gt 0 ]; then
              echo "💥 📢 Code blocks in documentation must be reformatted with blacken-docs 📢 💥"
          fi;
          exit $RESULT

  lint-docs:
    runs-on: ubuntu-latest
    name: lint-docs
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.13'
      - run: python -m pip install sphinx-lint
      - name: Build docs
        run: |
          cd docs
          make lint