forked from dfirtrack/dfirtrack
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 1.87 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
72
73
74
name: Django Tests
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 8
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
python-version: [3.6, 3.7, 3.8, 3.9]
services:
postgres:
image: postgres
env:
POSTGRES_USER: dfirtrack
POSTGRES_PASSWORD: dfirtrack
POSTGRES_DB: github_actions
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install psycopg2 prerequisites
run: sudo apt-get install python-dev libpq-dev
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests using coverage and convert result
run: |
coverage run manage.py test --settings=dfirtrack.test_settings
coverage json -o .coverage.json
coverage xml -o .coverage.xml
- name: Upload result to Codecov
uses: codecov/codecov-action@v1
with:
file: ./.coverage.xml
- name: Save JSON report for debugging
uses: actions/upload-artifact@v2
with:
name: coverage_json
path: .coverage.json
- name: Save SQLite report for debugging
uses: actions/upload-artifact@v2
with:
name: coverage_sqlite
path: .coverage
- name: Save XML report for debugging
uses: actions/upload-artifact@v2
with:
name: coverage_xml
path: .coverage.xml