Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Operator Engine CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout do código
uses: actions/checkout@v4

- name: 🐍 Instalar Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

Copy link

Copilot AI May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding caching for pip dependencies to improve build performance, such as using the actions/cache action.

Suggested change
- name: 📦 Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

Copilot uses AI. Check for mistakes.
- name: 🗂️ Cache dependências
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: 🔍 Verificar se requirements.txt existe
run: |
if [ ! -f requirements.txt ]; then
echo "::warning file=requirements.txt::Arquivo requirements.txt não encontrado. Criando vazio temporário..."
touch requirements.txt
fi

- name: 📦 Instalar dependências
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: 🧪 Rodar testes
run: |
pip install pytest
pytest tests/ || echo "::warning::Algum teste falhou."

- name: 🧾 Verificar estilo (PEP8)
run: |
pip install flake8
flake8 . --exclude=venv --max-line-length=120 || echo "::warning::Estilo de código (PEP8) não está 100%."

- name: 📤 Upload de logs (se existir)
if: always()
uses: actions/upload-artifact@v4
with:
name: logs
path: ./logs/
Loading