-
Notifications
You must be signed in to change notification settings - Fork 19
86 lines (73 loc) · 2.11 KB
/
Copy pathtest.yml
File metadata and controls
86 lines (73 loc) · 2.11 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
name: Test
on:
push:
branches:
- main
pull_request:
workflow_call: # Allow for the publish workflow to run the tests by calling this workflow
jobs:
test-sqlite:
name: Python ${{ matrix.python }} (sqlite)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install tox coverage
- name: Run tox targets for Python ${{ matrix.python }}
run: |
tox run -f py$(echo ${{ matrix.python }} | tr -d .)
coverage combine
coverage report
coverage xml
test-postgres:
name: Python ${{ matrix.python }} (postgres)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python: "3.10"
toxenv: "py310-dj52-wt70"
- python: "3.14"
toxenv: "py314-dj60-wt74"
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DATABASE_ENGINE: django.db.backends.postgresql
DATABASE_HOST: localhost
DATABASE_USER: postgres
DATABASE_PASS: postgres
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install tox psycopg
- name: Run tox env ${{ matrix.toxenv }}
run: tox -e ${{ matrix.toxenv }}