File: build-docs.yml

package info (click to toggle)
stravalib 2.4-2
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 5,340 kB
  • sloc: python: 4,462; makefile: 5
file content (54 lines) | stat: -rw-r--r-- 1,699 bytes parent folder | download
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
name: Build Documentation

on:
  pull_request:
  push:
    branches:
      - main

permissions: {}

jobs:
  build-doc:
    runs-on: ubuntu-latest
    env:
      PYTHON-VERSION: "3.11"
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          fetch-depth: 20
          persist-credentials: false
      - name: Setup Python
        uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
        with:
          python-version: ${{ env.PYTHON-VERSION }}
      - name: Upgrade pip & install nox
        run: |
          # install pip=>20.1 to use "pip cache dir"
          python3 -m pip install --upgrade pip
          pip install nox
      - name: Set Variables
        id: set_variables
        shell: bash
        run: |
          echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_OUTPUT
          echo "PIP_CACHE=$(pip cache dir)" >> $GITHUB_OUTPUT
      - name: Cache dependencies
        uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
        with:
          path: ${{ steps.set_variables.outputs.PIP_CACHE }}
          key: ${{ runner.os }}-pip-${{ steps.set_variables.outputs.PY }}
      - name: Install dependencies
        run: |
          pip install nox
      - name: Build docs & linkcheck
        run: |
          # Build html and link check
          nox -s docs
      - name: Print doc link failures in the output.txt file
        if: success() || failure()
        run: |
          cat docs/_build/linkcheck/output.txt | while read line
          do
            echo -e "$line \n"
          done