Skip to content

Commit

Permalink
Merge pull request #16 from bencrealc/lofensivo
Browse files Browse the repository at this point in the history
Configurado Github Actions
  • Loading branch information
bencrealc authored Jan 5, 2022
2 parents 78bd855 + 6a92d99 commit 7f599ce
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 7 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Python application

on: [push]

jobs:
build:
runs-on: ubuntu-latest

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 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- 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 voting --keepdb; coverage xml;
- name: Codacy Coverage Reporter
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: decide/coverage.xml
2 changes: 1 addition & 1 deletion decide/decide/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
'voting',
]

BASEURL = 'http://localhost:8000'
BASEURL = 'http://localhost:8000/'

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
Expand Down
14 changes: 14 additions & 0 deletions decide/voting/migrations/0010_merge_20220105_1639.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 2.0 on 2022-01-05 16:39

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('voting', '0007_merge_20220103_1820'),
('voting', '0009_question_ynns_question'),
]

operations = [
]
5 changes: 2 additions & 3 deletions decide/voting/serializers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from rest_framework import serializers
from .validators import lofensivo
from .models import Question, QuestionOption, Voting
from base.serializers import KeySerializer, AuthSerializer




class QuestionOptionSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = QuestionOption
Expand Down
3 changes: 0 additions & 3 deletions decide/voting/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def lofensivo(value):
palabras = value.split()

porcentaje= 20 / 100


numero= Percentage.objects.last()
cont = 0
res= False

Expand Down

0 comments on commit 7f599ce

Please sign in to comment.