-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (69 loc) · 1.97 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Adapted from https://github.com/AbstractUmbra/Hondana/blob/main/.github/workflows/coverage_and_lint.yaml
name: Type Coverage and Linting
on:
push:
branches:
- master
paths:
- bot/**
pull_request:
branches:
- master
types: [ opened, reopened, synchronize ]
paths:
- bot/**
jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: Type Coverage and Linting
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Load cached poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-0
- name: Setup poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
- name: Setup Python 3.11
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'poetry'
- name: Activate venv
run: |
source $(poetry env info --path)/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Load cached venv
id: cached-pip-wheels
uses: actions/cache@v3
with:
path: .venv/
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install python dependencies
if: ${{ steps.cached-pip-wheels.outputs.cache-hit != 'true' }}
id: install-deps
run: |
poetry install --no-interaction --no-root
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 19
- name: Pyright
run: poetry run pyright
- name: Lint
run: |
poetry run black bot --check
poetry run isort bot --check