aboutsummaryrefslogtreecommitdiff
blob: f2af40957d87f1ac711f5059542bb017a1254a34 (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
name: Lint

on: [ push, pull_request ]

jobs:
  black:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: "Collect stragglers that Black misses"
        id: stragglers
        run: |
          echo "::set-output name=missed::$(
          find bin runtests -type f -not -name '*.py' -not -name '*.sh' | \
          xargs grep -l '#!/usr/bin/env python' | tr $'\n' ' ')"
      - uses: psf/black@stable
        with:
            src: . ${{ steps.stragglers.outputs.missed }}

  pylint:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version:
          - '3.9'
          - '3.10'
          - '3.11'
          # pylint currently broken under 3.12
          # - '3.12-dev'
      fail-fast: false
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install python dependencies
        run: |
          set -xe
          python -VV
          python -m site
          python -m pip install --upgrade pip
          python -m pip install pylint pytest
      - name: Run pylint for ${{ matrix.python-version }}
        run: |
          ./run-pylint