-
Notifications
You must be signed in to change notification settings - Fork 4
114 lines (90 loc) · 3.12 KB
/
Copy pathtests.yml
File metadata and controls
114 lines (90 loc) · 3.12 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.4.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v6
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Run tests with coverage
run: |
poetry run pytest --cov=postmark --cov-report=xml --cov-report=term --cov-fail-under=85
django-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# Currently supported Django release series. The main `test` job above
# already exercises tests/django_backend/ against the pinned dev version
# (Django 5.2) across every supported Python version; this job additionally
# checks the Django backend against the rest of the support matrix.
django-version: ["4.2", "5.2", "6.0", "6.1"]
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
# 3.12 is the one Python version every entry in the matrix supports:
# Django 4.2 added 3.12 support in 4.2.8; Django 6.0/6.1 require 3.12+.
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.4.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction
- name: Install Django ${{ matrix.django-version }}
run: poetry run pip install "django~=${{ matrix.django-version }}.0"
- name: Run Django backend tests
run: poetry run pytest tests/django_backend/ -v
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 2.4.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
poetry install --no-interaction --with dev
- name: Run Ruff lint
run: poetry run ruff check .
- name: Run Ruff format
run: poetry run ruff format --check .
- name: Run MyPy
run: poetry run mypy postmark/