chore: Add testing GitHub Action #1
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
# Este workflow instalará as dependências Python, executará testes e lint com uma única versão do Python | |
# Para mais informações, veja: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Pytest | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.8" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --user poetry | |
poetry install | |
# - name: Lint with flake8 | |
# run: | | |
# # interrompe a build se houver erros de sintaxe Python ou nomes indefinidos | |
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# # exit-zero trata todos os erros como avisos. O editor do GitHub tem 127 caracteres de largura | |
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
run: | | |
poetry run pytest |