-
-
Notifications
You must be signed in to change notification settings - Fork 120
73 lines (57 loc) · 1.63 KB
/
python.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
name: Python
on:
push:
workflow_dispatch:
env:
LINT_PYTHON_VERSION: 3.11
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install Poetry
run: |
pipx install poetry
poetry config virtualenvs.path ~/.virtualenvs$LINT_PYTHON_VERSION
- name: Set up Python $LINT_PYTHON_VERSION
uses: actions/setup-python@v3
with:
python-version: $LINT_PYTHON_VERSION
cache: "poetry"
- name: Install dependencies
run: |
poetry install
- name: ruff check
run: poetry run ruff check .
- name: mypy check
run: poetry run mypy django_unicorn
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
django-version: ["4.1", "4.2", "5.0"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install Poetry
run: |
pipx install poetry
poetry config virtualenvs.path ~/.virtualenvs${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: |
poetry env use ${{ matrix.python-version }}
poetry add django==${{ matrix.django-version }}
poetry install -E minify
- name: Fast tests
run: poetry run pytest -m 'not slow'
- name: Slow tests
run: poetry run pytest -m 'slow'