forked from EGCETSII/decide_django_2
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Comienzo GitHub Actions-Codacy; #16
Se ha comenzado a configurar el repositorio del grupo para la automatización de las pruebas.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |