Skip to content

Commit

Permalink
Feature: Comienzo GitHub Actions-Codacy; #16
Browse files Browse the repository at this point in the history
Se ha comenzado a configurar el repositorio del grupo para la automatización de las pruebas.
  • Loading branch information
Jomer1998 committed Dec 21, 2021
1 parent 10edd93 commit 048d7b3
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Python application

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
pyversion: ['3.5','3.8']
services:
postgres:
image: postgres:10.8
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@v1
- name: Set up Python ${{matrix.pyversion}}
uses: actions/setup-python@v1
with:
python-version: ${{matrix.pyversion}}
- name: psycopg2 prerequisites
run: sudo apt-get install libpq-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install codacy-coverage
- name: Run migrations
run: cd decide;python manage.py migrate
- name: Run tests
run: cd decide;coverage run --branch --source=. ./manage.py test census --keepdb; coverage xml;
- name: Codacy Coverage Reporter
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: decide/coverage.xml

0 comments on commit 048d7b3

Please sign in to comment.