diff --git a/workflow.yaml b/workflow.yaml new file mode 100644 index 0000000..78e2141 --- /dev/null +++ b/workflow.yaml @@ -0,0 +1,56 @@ +name: Operator Engine CI + +on: + push: + branches: [ "main", "dev", "release" ] + pull_request: + branches: [ "main", "dev" ] + workflow_dispatch: + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repositório + uses: actions/checkout@v3 + + - name: Configurar Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Cache Python dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Instalar dependências + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + + - name: Verificar PEP8 com flake8 + run: | + pip install flake8 + flake8 operator_engine/ --count --select=E9,F63,F7,F82 --show-source --statistics + + - name: Executar testes (PyTest) + run: | + pip install pytest + pytest tests/ --maxfail=3 --disable-warnings + + - name: Validar tipo com mypy + run: | + pip install mypy + mypy operator_engine/ + + - name: Upload de artefatos (logs, jsons) + if: always() + uses: actions/upload-artifact@v3 + with: + name: engine-logs + path: logs/*.json \ No newline at end of file