Skip to content

Create requeriments.txt #2

Create requeriments.txt

Create requeriments.txt #2

Workflow file for this run

# Este workflow irá instalar as dependências Python, rodar testes e aplicar lint usando flake8
# Mais informações: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Automator Workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
# Faz checkout do repositório
- name: Checkout code
uses: actions/checkout@v4
# Configura o Python 3.10
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
# Instala dependências
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# Lint com flake8
- name: Lint with flake8
run: |
# Para a build em caso de erros de sintaxe ou nomes indefinidos
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Trata os erros como warnings e verifica a complexidade e comprimento das linhas
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Testa com pytest
- name: Test with pytest
run: |
pytest