-
Notifications
You must be signed in to change notification settings - Fork 5.3k
57 lines (50 loc) · 1.36 KB
/
linters.yml
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
# Check that code is formatted consistently
#
# Available Python versions:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
name: linters
on:
push:
branches:
- master
pull_request:
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {name: Linux312, python: '3.12.3', os: ubuntu-latest}
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Restore cache
id: cache
uses: actions/cache@v3
with:
path: ./venv
key: ${{ matrix.name }}-v1-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ matrix.name }}-v1-pip-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Check code style
run: |
. venv/bin/activate
python -m ruff check .
python -m black --check .
- name: Check directory layout
run: |
. venv/bin/activate
python .github/workflows/dircheck.py