-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (61 loc) · 1.81 KB
/
linting.yaml
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
name: linting
on:
push:
branches:
- master
- stable
pull_request:
branches:
- master
- stable
jobs:
setup:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
- name: Set up Python
id: python
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
# TODO: Remove explicit Python version once bug with .python-version file is solved
# https://github.com/actions/setup-python/issues/734
python-version: '3.11'
cache: 'poetry'
- name: Install dependencies
if: steps.python.outputs.cache-hit != 'true'
run: |
poetry install --no-root
lint:
needs: setup
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
- name: Set up Python
id: python
uses: actions/setup-python@v4
with:
# TODO: Remove explicit Python version once bug with .python-version file is solved
# https://github.com/actions/setup-python/issues/734
python-version: '3.11'
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: Run tests
env:
NO_COLORS: true # Disable colors in ruff output
run: |
echo "::add-matcher::.github/matchers/mypy.json"
echo "::add-matcher::.github/matchers/ruff.json"
echo "::add-matcher::.github/matchers/unbehead.json"
poetry run -- make lint --keep-going
echo "::remove-matcher owner=unbehead::"
echo "::remove-matcher owner=ruff::"
echo "::remove-matcher owner=mypy::"