-
Notifications
You must be signed in to change notification settings - Fork 9
116 lines (97 loc) · 2.74 KB
/
Copy pathtesting-52.yaml
File metadata and controls
116 lines (97 loc) · 2.74 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
115
116
name: Testing Django 5.2
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
Django52:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.14.2'
- '3.13.11'
- '3.12.12'
- '3.11.14'
- '3.10.19'
django-version:
- '5.2.13'
database-target:
- 'mysql'
- 'postgres'
- 'sqlite'
env:
DATABASE_ENGINE: ${{ matrix.database-target }}
DJANGO_VERSION: ${{ matrix.django-version }}
services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: gh_actions_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: gh_actions_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v6
- name: Install the latest version of `uv`
uses: astral-sh/setup-uv@v7
with:
enable-cache: "auto"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync
uv pip install Django==${{ matrix.django-version }}
- name: Install dependencies (if mysql)
if: ${{ matrix.database-target == 'mysql' }}
run: |
uv pip install mysqlclient
- name: Install dependencies (if postgres)
if: ${{ matrix.database-target == 'postgres' }}
run: |
uv pip install psycopg2
- name: Environment Report
run: |
echo Python Version ... $(python --version)
echo Django Version ... ${DJANGO_VERSION}
echo Database Used .... ${DATABASE_ENGINE}
- name: Unit Testing
run: make test-unit
- name: Coverage Report
run: make test-coverage-report
- name: Local Integration Testing
run: make test-integration
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
if: ${{ !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: junit.xml
report_type: test_results