summaryrefslogtreecommitdiffstats
path: root/.github/workflows/lint.yml
blob: 45275510023f963fc4a3cbcac9143791ff3f72ec (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
name: Lint

on:
  push:
    # This should disable running the workflow on tags, according to the
    # on.<push|pull_request>.<branches|tags> GitHub Actions docs.
    branches:
      - "*"
  pull_request:

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

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: actions/setup-python@v4
        with:
          python-version: "3.10"

      - name: install packages to tests
        run: pip install ./psycopg[dev,test] codespell

      - name: Run black
        run: black --check --diff .

      - name: Run flake8
        run: flake8

      - name: Run mypy
        run: mypy

      - name: Check spelling
        run: codespell

      - name: Install requirements to generate docs
        run: sudo apt-get install -y libgeos-dev

      - name: Install Python packages to generate docs
        run: pip install ./psycopg[docs] ./psycopg_pool

      - name: Check documentation
        run: sphinx-build -W -T -b html docs docs/_build/html