File: build-docs.yml

package info (click to toggle)
python-openapi-schema-validator 0.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: python: 1,186; makefile: 46
file content (52 lines) | stat: -rw-r--r-- 1,443 bytes parent folder | download | duplicates (2)
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
name: Build documentation

on:
  push:
  pull_request:
    types: [opened, synchronize]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

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

      - name: Get full Python version
        id: full-python-version
        run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")

      - name: Set up poetry
        uses: Gr1N/setup-poetry@v9

      - name: Configure poetry
        run: poetry config virtualenvs.in-project true

      - name: Set up cache
        uses: actions/cache@v4
        id: cache
        with:
          path: .venv
          key: venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

      - name: Ensure cache is healthy
        if: steps.cache.outputs.cache-hit == 'true'
        run: timeout 10s poetry run pip --version || rm -rf .venv

      - name: Install dependencies
        run: poetry install --with docs

      - name: Build documentation
        run: |
          poetry run python -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs docs/_build/html -n -W

      - uses: actions/upload-artifact@v4
        name: Upload docs as artifact
        with:
          name: docs-html
          path: './docs/_build/html'
          if-no-files-found: error