Skip to content

Tests unitarios - Capa de servicio #3

Tests unitarios - Capa de servicio

Tests unitarios - Capa de servicio #3

Workflow file for this run

name: Tests
on:
push:
branches:
- master
- develop
pull_request:
branches:
- '*'
jobs:
test:
name: Tests microservice
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Run tests & Coverage file
run: |
python -m venv venv
source venv/bin/activate
pytest
pytest --cache-clear --cov=app/service app/tests/ --cov-report=xml > pytest-coverage.txt
env:
DATABASE_URL: postgresql://pepe
PYTHONPATH: ./app
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
directory: ./coverage/reports/
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
path_to_write_report: ./coverage/codecov_report.txt
verbose: true