-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (73 loc) · 2.06 KB
/
main.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
65
66
67
68
69
70
71
72
73
name: Review
on:
push:
branches:
- 'main'
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: pre-commit/action@v3.0.0
checks:
name: Check typing and linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup env
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Bootstrap Poetry
run: |
pip install pipx
pipx install poetry
pipx install flake8
pipx install isort
pipx install black
- name: Install dependencies
run: poetry install --all-extras
- name: Run mypy
run: poetry run mypy
- name: Run flake8
run: poetry run flake8
- name: Run isort
run: poetry run isort . -c
- name: Run black
run: poetry run black . --check
tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }} / ${{ matrix.poetry-version }}
strategy:
matrix:
os: [ubuntu-latest, windows-2022, macos-12]
python-version: ["3.9", "3.12"]
poetry-version:
- "git+https://github.com/python-poetry/poetry.git"
- "poetry==1.2.0"
- "poetry==1.2.1"
- "poetry==1.3.0"
- "poetry==1.3.1"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup env
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Bootstrap Poetry
run: |
pip install pipx
pipx install poetry
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry install --only main --only test
poetry run pip install ${{ matrix.poetry-version }}
- name: Run tests
run: poetry run pytest