-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (55 loc) · 1.68 KB
/
tests.yaml
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
name: CI Testing
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test:
name: "Python ${{ matrix.python }} Django ${{ matrix.django }}"
runs-on: ubuntu-latest
strategy:
# max-parallel: 8 # default is max available
fail-fast: false
matrix:
include:
# Django 2.2
- django: "2.2"
python: "3.6"
# Django 3.1
- django: "3.1"
python: "3.6"
# Django 3.2
- django: "3.2"
python: "3.6"
# Django 4.0
- django: "4.0b1"
python: "3.10"
steps:
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
# Way more efficient then caching pip
- name: Cache Python site-packages
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ matrix.django }}-${{ hashFiles('setup.py') }}
# Using eager strategy to avoid reusing older packages from cache
- name: Install Packages
run: |
python -m pip install -U pip
python -m pip install -U --upgrade-strategy=eager "Django~=${{ matrix.django }}" codecov -e .[tests]
- name: Run Tests
run: |
echo "Python ${{ matrix.python }} / Django ${{ matrix.django }}"
coverage run --rcfile=.coveragerc runtests.py
codecov
continue-on-error: ${{ contains(matrix.django, '4.0') }}