Skip to content

Enhance README with AWS and Docker setup details #47

Enhance README with AWS and Docker setup details

Enhance README with AWS and Docker setup details #47

Workflow file for this run

name: CI Pipeline
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test-backend:
name: Test Backend + Lint + Build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123
POSTGRES_DB: listacompras_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=5s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout código
uses: actions/checkout@v4
- name: Configurar Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Instalar dependências do backend
working-directory: backend
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install flake8 pytest
- name: Rodar flake8 (lint)
working-directory: backend
run: |
flake8 . --max-line-length=120
- name: Rodar testes (pytest)
env:
PYTHONPATH: ${{ github.workspace }}/backend
DATABASE_URL: postgresql://postgres:123@localhost:5432/listacompras_test
TEST_DATABASE_URL: postgresql://postgres:123@localhost:5432/listacompras_test
SECRET_KEY: "testingkey"
run: |
python -m pytest backend/tests/ -q --disable-warnings --maxfail=1
- name: Testar build do Docker (backend e frontend)
run: |
docker compose -f docker-compose.yml build