summaryrefslogtreecommitdiffstats
path: root/.github/workflows/docs.yaml
blob: 2ffb21079d58028d58737ab45ade0946a755e66f (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
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html

name: Docs

on:
  push:
    branches: [ develop, release ]
    paths:
    - 'docs/**'
    - 'docs_theme/**'
    - 'mkdocs.yml'
    - 'readthedocs.yml'
    - '.github/workflows/docs.yaml'
    - 'tasks.py'
    - 'pyproject.toml'
  pull_request:
    branches: [ develop ]
    paths:
    - 'docs/**'
    - 'docs_theme/**'
    - 'mkdocs.yml'
    - 'readthedocs.yml'
    - '.github/workflows/docs.yaml'
    - 'tasks.py'
    - 'pyproject.toml'

jobs:
  accessibility:
    if: contains(toJson(github.event.commits), '[ci skip]') == false
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        python-version: [ '3.11' ]
        os: [ ubuntu-latest ]

    steps:
    - uses: actions/checkout@v4

    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}

    - name: Setup Node.js environment
      uses: actions/setup-node@main

    - name: Capture full Python version in env
      run: echo "PYTHON_FULL_VERSION=$(python --version)" >> "$GITHUB_ENV"

    - name: poetry cache
      uses: actions/cache@v4
      with:
        path: .venv
        key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_FULL_VERSION }}-${{ secrets.CACHE_STRING }}

    - name: npm cache
      uses: actions/cache@v4
      with:
        path: node_modules
        key: ${{ runner.os }}-pa11y-v3

    - name: Install dependencies
      run: |
        pip install poetry
        poetry config --local virtualenvs.in-project true
        poetry install --no-root --remove-untracked
        npm install
        echo "node_modules/.bin" >> "$GITHUB_PATH"

    - name: Start docs server
      run: poetry run poe docs-run &

    - name: Accessibility testing (Pa11y)
      run: poetry run poe docs-check