forked from zpurcey/new-teamtemp
-
Notifications
You must be signed in to change notification settings - Fork 5
51 lines (49 loc) · 1.44 KB
/
django-test.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
name: Django Test
on:
workflow_call:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11"]
env:
DATABASE_URL: "sqlite:///:memory"
DJANGO_SETTINGS_MODULE: teamtemp.settings.dev
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
pip install -U pip wheel setuptools
pip install -U -r requirements/dev.txt
- name: Setup
run: |
python manage.py migrate --no-input
python manage.py collectstatic --no-input
- name: Run tests
run: |
coverage run manage.py test
coverage xml
coverage lcov
- name: Upload coverage to coveralls.io
uses: coverallsapp/github-action@v2
with:
github-token: ${{ github.token }}
path-to-lcov: coverage.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
#token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
verbose: true