Files
Felipe Cardoso c0b253a010 Add support for E2E testing infrastructure and OAuth configurations
- Introduced make commands for E2E tests using Testcontainers and Schemathesis.
- Updated `.env.demo` with configurable OAuth settings for Google and GitHub.
- Enhanced `README.md` with updated environment setup instructions.
- Added E2E testing dependencies and markers in `pyproject.toml` for real PostgreSQL and API contract validation.
- Included new libraries (`arrow`, `attrs`, `docker`, etc.) for testing and schema validation workflows.
2025-11-25 22:24:23 +01:00
..

GitHub Actions Workflows

This directory contains CI/CD workflow templates for automated testing and deployment.

🚀 Quick Setup

To enable CI/CD workflows:

  1. Rename template files by removing the .template extension:

    mv backend-tests.yml.template backend-tests.yml
    mv frontend-tests.yml.template frontend-tests.yml
    mv e2e-tests.yml.template e2e-tests.yml
    
  2. Set up Codecov (optional, for coverage badges):

    • Sign up at https://codecov.io
    • Add your repository
    • Get your CODECOV_TOKEN
    • Add it to GitHub repository secrets
  3. Update README badges: Replace the static badges in the main README.md with:

    [![Backend Tests](https://github.com/YOUR_ORG/YOUR_REPO/actions/workflows/backend-tests.yml/badge.svg)](https://github.com/YOUR_ORG/YOUR_REPO/actions/workflows/backend-tests.yml)
    [![Backend Coverage](https://codecov.io/gh/YOUR_ORG/YOUR_REPO/branch/main/graph/badge.svg?flag=backend)](https://codecov.io/gh/YOUR_ORG/YOUR_REPO)
    [![Frontend Tests](https://github.com/YOUR_ORG/YOUR_REPO/actions/workflows/frontend-tests.yml/badge.svg)](https://github.com/YOUR_ORG/YOUR_REPO/actions/workflows/frontend-tests.yml)
    [![Frontend Coverage](https://codecov.io/gh/YOUR_ORG/YOUR_REPO/branch/main/graph/badge.svg?flag=frontend)](https://codecov.io/gh/YOUR_ORG/YOUR_REPO)
    [![E2E Tests](https://github.com/YOUR_ORG/YOUR_REPO/actions/workflows/e2e-tests.yml/badge.svg)](https://github.com/YOUR_ORG/YOUR_REPO/actions/workflows/e2e-tests.yml)
    

📋 Workflow Descriptions

backend-tests.yml

  • Runs on: Push to main/develop, PRs affecting backend code
  • Tests: Backend unit and integration tests
  • Coverage: Uploads to Codecov
  • Database: Spins up PostgreSQL service

frontend-tests.yml

  • Runs on: Push to main/develop, PRs affecting frontend code
  • Tests: Frontend unit tests (Jest)
  • Coverage: Uploads to Codecov
  • Fast: Uses npm cache

e2e-tests.yml

  • Runs on: All pushes and PRs
  • Tests: End-to-end tests (Playwright)
  • Coverage: Full stack integration
  • Artifacts: Saves test reports for 30 days

🔧 Customization

Adjust trigger paths

Modify the paths section to control when workflows run:

paths:
  - 'backend/**'
  - 'shared/**'  # Add if you have shared code

Change test commands

Update the test steps to match your needs:

- name: Run tests
  run: pytest -v --custom-flag

Add deployment

Create a new workflow for deployment:

name: Deploy to Production
on:
  push:
    branches: [ main ]
    tags: [ 'v*' ]

🛡️ Security

  • Never commit secrets to workflows
  • Use GitHub Secrets for sensitive data
  • Review workflow permissions
  • Keep actions up to date

📊 Coverage Reports

With Codecov enabled, you'll get:

  • Coverage trends over time
  • PR coverage comparisons
  • Coverage per file/folder
  • Interactive coverage explorer

Access at: https://codecov.io/gh/YOUR_ORG/YOUR_REPO

💡 Tips

  • PR checks: Workflows run on PRs automatically
  • Status checks: Set as required in branch protection
  • Debug logs: Re-run with debug logging enabled
  • Artifacts: Download from workflow run page
  • Matrix builds: Test multiple Python/Node versions

📚 Further Reading