Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c64b15c
feat(devops): add Docker setup for backend services
Yosoyepa Nov 6, 2025
baf553e
Merge pull request #2 from Yosoyepa/feature/ci-cd-integration
Yosoyepa Nov 6, 2025
79d3f8e
feat(ci): Add GitHub Actions lint workflow - CGAI-23
Yosoyepa Nov 6, 2025
7332006
Merge pull request #3 from Yosoyepa/feature/github-actions-lint
Yosoyepa Nov 6, 2025
797b087
feat(ci): Add tests and coverage workflow - CGAI-24
Yosoyepa Nov 7, 2025
8e4ef82
Merge pull request #4 from Yosoyepa/feature/github-actions-test
Yosoyepa Nov 7, 2025
918f2ad
feat(ci): Add Docker build validation workflow - CGAI-25
Yosoyepa Nov 7, 2025
e519d8e
Merge pull request #5 from Yosoyepa/feature/github-actions-docker
Yosoyepa Nov 7, 2025
cefcaa7
feat(docs): Add contribution guide and CI/CD documentation
Yosoyepa Nov 7, 2025
532f824
Update docs/ci-cd-setup.md
Yosoyepa Nov 7, 2025
3500b24
Merge pull request #6 from Yosoyepa/feature/update-docs
Yosoyepa Nov 7, 2025
f2abd9c
fix(ci): Add docker-compose installation to GitHub Actions workflow -…
Yosoyepa Nov 7, 2025
e97d38d
fix(quality): Apply GitHub Copilot suggestions for code quality impro…
Yosoyepa Nov 7, 2025
e3a177c
Merge pull request #9 from Yosoyepa/feature/update-docs
Yosoyepa Nov 7, 2025
5af4876
Merge pull request #7 from Yosoyepa/develop
jpastor1649 Nov 8, 2025
2d5c111
feat(CGAI-20): Implementar endpoint POST /api/v1/analyze con persiste…
jpastor1649 Nov 23, 2025
ce07060
Black formatting applied
jpastor1649 Nov 23, 2025
7198ba5
Apply Black formatting across backend/src
jpastor1649 Nov 23, 2025
305ee0d
Merge branch 'feature20' of https://github.com/jpastor1649/feature-CG…
jpastor1649 Nov 23, 2025
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
49 changes: 49 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Build

on:
push:
branches: [main, develop]
paths:
- "backend/Dockerfile"
- "backend/docker-compose.yml"
- "backend/requirements.txt"
- ".github/workflows/docker.yml"
pull_request:
branches: [main]

jobs:
build:
name: Build Docker Image
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Install docker-compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Build backend image
run: |
cd backend
docker build --tag codeguard-backend:${{ github.sha }} .

- name: Test Docker image
run: |
docker run --rm codeguard-backend:${{ github.sha }} python --version

- name: Test Docker Compose (validation only)
run: |
cd backend
docker-compose config

- name: Summary
if: success()
run: |
echo " Docker image built successfully!"
echo " Image: codeguard-backend:${{ github.sha }}"
56 changes: 56 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Lint & Format Check

on:
push:
branches: [main, develop, "feature/**"]
paths:
- "backend/**/*.py"
- ".github/workflows/lint.yml"
pull_request:
branches: [main, develop]
paths:
- "backend/**/*.py"

jobs:
lint:
name: Code Quality Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install linting dependencies
run: |
python -m pip install --upgrade pip
pip install black>=23.0.0 flake8>=7.0.0 isort>=5.13.0

- name: Check code formatting with Black
run: |
cd backend
black src/ --line-length=100 --check

- name: Check import sorting with isort
run: |
cd backend
isort src/ --profile=black --line-length=100 --check-only

- name: Lint with Flake8
run: |
cd backend
flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/ --count --max-complexity=10 --max-line-length=100 --statistics

- name: Summary
if: success()
run: |
echo "= All code quality checks passed!"
echo "- Black formatting: ✓"
echo "- Import sorting (isort): ✓"
echo "- Linting (flake8): ✓"
65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Tests & Coverage

on:
push:
branches: [main, develop, "feature/**"]
paths:
- "backend/**/*.py"
- "backend/tests/**"
- ".github/workflows/test.yml"
pull_request:
branches: [main, develop]
paths:
- "backend/**/*.py"
- "backend/tests/**"

jobs:
test:
name: Run Tests & Coverage
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install dependencies
run: |
cd backend
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest>=8.0.0 pytest-asyncio>=0.23.0 pytest-cov>=4.1.0

- name: Run tests with coverage
run: |
cd backend
pytest tests/ --cov=src --cov-report=html --cov-report=term-missing --cov-report=xml --cov-fail-under=75 -v
continue-on-error: false

- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: backend/htmlcov/
retention-days: 30

- name: Upload coverage to Codecov (optional)
if: always()
uses: codecov/codecov-action@v4
with:
file: backend/coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

- name: Summary
if: success()
run: |
echo "All tests passed with >75% coverage!"
echo "Coverage report uploaded as artifact"
Loading
Loading