Skip to content
Merged
Show file tree
Hide file tree
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
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on:
pull_request:
push:
branches:
- main

jobs:
backend:
name: Backend Quality Checks
runs-on: ubuntu-latest

defaults:
run:
working-directory: backend

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

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

- name: Install backend dependencies
run: pip install -r requirements.txt

- name: Run Ruff
run: python -m ruff check .

- name: Run Black check
run: python -m black . --check

frontend:
name: Frontend Quality Checks
runs-on: ubuntu-latest

defaults:
run:
working-directory: frontend

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"

- name: Install frontend dependencies
run: npm ci

- name: Run frontend lint
run: npm run lint

- name: Build frontend
run: npm run build

infrastructure:
name: Docker and Kubernetes Validation
runs-on: ubuntu-latest

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

- name: Build backend Docker image
run: docker build -t kmeans-backend ./backend

- name: Build frontend Docker image
run: docker build -t kmeans-frontend ./frontend

- name: Validate Kubernetes manifests
run: run: kubectl apply --dry-run=client --validate=false -f k8s/
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,20 @@ The project is designed as an educational tool for learning machine learning fun

* Enhanced centroid movement visualization
* Inertia charts
* GitHub Actions CI/CD
* Cluster assignment visualization improvements
* Responsive UI
* Dark mode
* Linear Regression Visualizer

### 🔄 Continuous Integration

* Automated backend quality checks
* Automated frontend linting
* Automated frontend production build verification
* Automated Docker image builds
* Automated Kubernetes manifest validation
* GitHub Actions CI workflow

---

## 🛠️ Tech Stack
Expand All @@ -100,14 +108,17 @@ The project is designed as an educational tool for learning machine learning fun
* Docker Compose
* Kubernetes
* Ingress
* GitHub Actions (planned)
* GitHub Actions

---

## 📁 Project Structure

```text
KMeansVisualizer/
.github/
├── workflows/
│ └── ci.yml
├── backend/
│ ├── schemas/
│ │ ├── __init__.py
Expand Down Expand Up @@ -515,6 +526,27 @@ http://localhost:8000/docs

---

## 🔄 GitHub Actions CI

The project includes an automated CI workflow executed on every push and pull request.

### Automated Checks

* Backend Ruff linting
* Backend Black formatting verification
* Frontend ESLint verification
* Frontend production build verification
* Backend Docker image build
* Frontend Docker image build
* Kubernetes manifest validation

### Workflow File

```text
.github/workflows/ci.yml
```
---

## ✅ Code Quality

### Backend Code Formatting
Expand Down Expand Up @@ -618,7 +650,7 @@ kubectl describe pod <pod-name>
* `Liveness Probe` - Container health checks
* `Readiness Probe` - Traffic readiness checks
* `PowerShell Scripts` - Kubernetes automation
* `GitHub Actions` - CI/CD (planned)
* `GitHub Actions` - Continuous Integration

---

Expand Down Expand Up @@ -649,4 +681,4 @@ This project demonstrates:
* Infrastructure Automation
* Kubernetes Operational Workflows
* Deployment Automation
* CI/CD Automation (planned)
* CI/CD Automation