Ajustado pytest-django apenas para ambiente dev #109
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
name: Curso Django | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
env: | |
PIPENV_NO_INHERIT: 1 | |
PIPENV_IGNORE_VIRTUALENVS: 1 | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15.2 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: [ '5432:5432' ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -q pipenv | |
pipenv sync -d | |
cp contrib/env-sample .env | |
- name: Lint with flake8 | |
run: | | |
pipenv run flake8 . | |
- name: Tests with pytest | |
run: | | |
pipenv run pytest --cov=pypro --cov-report=xml | |
- name: Upload coverage reports to Codecov with GitHub Action... | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |