forked from EGCETSII/decide
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (51 loc) · 1.52 KB
/
django.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
name: Python application
on:
push:
branches:
- develop
- master
jobs:
build:
strategy:
matrix:
pyversion: ['3.8','3.9']
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.18-bullseye
env:
POSTGRES_USER: decide
POSTGRES_PASSWORD: decide
POSTGRES_DB: decide
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{matrix.pyversion}}
uses: actions/setup-python@v4
with:
python-version: ${{matrix.pyversion}}
- name: psycopg2 prerequisites
run: sudo apt-get install libpq-dev
- name: Install dependencies and config
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install codacy-coverage
cp decide/local_settings.gactions.py decide/local_settings.py
- name: Run migrations (unnecessary)
run: |
cd decide
python manage.py migrate
- name: Run tests
run: |
cd decide
coverage run --branch --source=. ./manage.py test --keepdb
coverage xml
- name: Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: decide/coverage.xml