-
-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (54 loc) · 1.71 KB
/
lint.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
58
59
60
61
62
63
64
name: lint
on:
push:
branches:
- master
pull_request:
jobs:
pyright:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
fail-fast: false
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up python
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Load cached Poetry installation
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-0
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Export dependencies
run: poetry export --no-interaction -f requirements.txt --output requirements.txt --with lint,docs,dev
- name: Install dependencies
run: pip install -r requirements.txt
- name: Set up pyright
run: echo "PYRIGHT_VERSION=$(python -c 'import pyright; print(pyright.__pyright_version__)')" >> $GITHUB_ENV
- name: Run pyright (Linux)
uses: jakebailey/[email protected]
with:
version: ${{ env.PYRIGHT_VERSION }}
python-version: ${{ matrix.python-version }}
python-platform: Linux
# only add comments for 3.8
no-comments: ${{ matrix.python-version != '3.8' }}
warnings: true
- name: Run pyright (Windows)
uses: jakebailey/[email protected]
# run anyway
if: success() || failure()
with:
version: ${{ env.PYRIGHT_VERSION }}
python-version: ${{ matrix.python-version }}
python-platform: Windows
# only add comments for one platform
no-comments: true
warnings: true