-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (50 loc) · 1.7 KB
/
Copy pathchecks.yml
File metadata and controls
62 lines (50 loc) · 1.7 KB
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
name: Run Checks
on:
push:
pull_request:
env:
POETRY_VERSION: 1.7.1
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
env:
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
- name: Cache poetry install
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-${{ env.POETRY_VERSION }}-${{ matrix.python-version }}-${{ runner.os }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache deps
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}-${{ env.POETRY_VERSION }}-${{ matrix.python-version }}-${{ runner.os }}
# `--no-root` means "install all dependencies but not the project
# itself", which is what you want to avoid caching _your_ code. The `if` statement
# ensures this only runs on a cache miss.
- run: poetry install --no-interaction --no-root --all-extras
if: steps.cache-deps.outputs.cache-hit != 'true'
- run: poetry install --no-interaction --all-extras
- name: Run Pylint
run: poetry run pylint byteguide/
- name: Run MyPy
run: poetry run mypy .
- name: Check Formatting
run: poetry run black --check .