-
Notifications
You must be signed in to change notification settings - Fork 50
97 lines (83 loc) · 2.45 KB
/
Copy pathtest.yml
File metadata and controls
97 lines (83 loc) · 2.45 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
name: test
on:
push:
branches: [main]
pull_request:
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
test:
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
django-version: ["4.2", "5.2", "main"]
exclude:
- python-version: "3.14"
django-version: "4.2"
- python-version: "3.13"
django-version: "4.2"
- python-version: "3.10"
django-version: "main"
- python-version: "3.11"
django-version: "main"
steps:
- uses: actions/checkout@v5
- uses: extractions/setup-just@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [[ "${{ matrix.django-version }}" == "main" ]]; then
python -m pip install https://github.com/django/django/archive/refs/heads/main.zip
else
python -m pip install django==${{ matrix.django-version }}
fi
python -m pip install '.[tests]'
- name: Run tests
run: |
just test
tests:
runs-on: ubuntu-latest
needs: test
if: always()
steps:
- name: OK
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Fail
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
coverage:
runs-on: ubuntu-latest
env:
PYTHON_MIN_VERSION: "3.10"
DJANGO_MIN_VERSION: "4.2"
steps:
- uses: actions/checkout@v5
- uses: extractions/setup-just@v3
- name: Set up Python ${{ env.PYTHON_MIN_VERSION }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_MIN_VERSION }}
cache: "pip"
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install django==${{ env.DJANGO_MIN_VERSION }}
python -m pip install '.[tests]'
- name: Run coverage
run: |
just coverage