-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (67 loc) · 2.01 KB
/
django-tests.yml
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
name: Django CI
on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master ]
jobs:
test:
name: Tests; Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
max-parallel: 2
matrix:
python-version: ['3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies for Django
run: |
python -m pip install --upgrade pip
pip install wheel # Install wheel for packages using legacy install methods
pip install -e .[dev]
- name: Run Tests
working-directory: dev
run: |
python manage.py test
coverage:
name: Coverage; Python 3.9
runs-on: ubuntu-latest
continue-on-error: true
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
cache: pip
cache-dependency-path: dev/requirements.txt
- name: Install Dependencies for Django
run: |
python -m pip install --upgrade pip
pip install wheel # Install wheel for packages using legacy install methods
pip install -e .[dev]
- name: Install coverage.py
run: |
pip install coverage
- name: Run coverage
working-directory: dev
run: |
coverage run --source='..' manage.py test
- name: Create coverage output files
working-directory: dev
run: |
mkdir cov
coverage html --directory cov/html
coverage xml -o cov/cobertura.coverage.xml
coverage report > cov/report.txt
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: dev/cov/