From 7264a18c8d125fbf4a22dc3ed2e365b6a4838ff3 Mon Sep 17 00:00:00 2001 From: Wiola Date: Mon, 22 Jun 2026 15:03:31 +0200 Subject: [PATCH 1/5] ci: add backend quality checks --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..485deca --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +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 \ No newline at end of file From 6da462cabd04df1de98136d09e43692b78ef1e5a Mon Sep 17 00:00:00 2001 From: Wiola Date: Mon, 22 Jun 2026 15:09:29 +0200 Subject: [PATCH 2/5] ci: add frontend lint and build checks --- .github/workflows/ci.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 485deca..4c34f4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,4 +31,30 @@ jobs: run: python -m ruff check . - name: Run Black check - run: python -m black . --check \ No newline at end of file + 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 \ No newline at end of file From d31fdfaf11af626cf2ec60eb282fe25131fb4799 Mon Sep 17 00:00:00 2001 From: Wiola Date: Mon, 22 Jun 2026 15:15:42 +0200 Subject: [PATCH 3/5] ci: add docker and kubernetes validation --- .github/workflows/ci.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c34f4c..d407aa1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,4 +57,21 @@ jobs: run: npm run lint - name: Build frontend - run: npm run build \ No newline at end of file + 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: kubectl apply --dry-run=client -f k8s/ \ No newline at end of file From 046b43a2459f8a698f267d642bd2372be2b361a0 Mon Sep 17 00:00:00 2001 From: Wiola Date: Mon, 22 Jun 2026 15:22:24 +0200 Subject: [PATCH 4/5] docs: add github actions documentation --- README.md | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f19dcf0..18cb845 100644 --- a/README.md +++ b/README.md @@ -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 @@ -100,7 +108,7 @@ The project is designed as an educational tool for learning machine learning fun * Docker Compose * Kubernetes * Ingress -* GitHub Actions (planned) +* GitHub Actions --- @@ -108,6 +116,9 @@ The project is designed as an educational tool for learning machine learning fun ```text KMeansVisualizer/ +.github/ +├── workflows/ +│ └── ci.yml ├── backend/ │ ├── schemas/ │ │ ├── __init__.py @@ -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 @@ -618,7 +650,7 @@ kubectl describe pod * `Liveness Probe` - Container health checks * `Readiness Probe` - Traffic readiness checks * `PowerShell Scripts` - Kubernetes automation -* `GitHub Actions` - CI/CD (planned) +* `GitHub Actions` - Continuous Integration --- @@ -649,4 +681,4 @@ This project demonstrates: * Infrastructure Automation * Kubernetes Operational Workflows * Deployment Automation -* CI/CD Automation (planned) \ No newline at end of file +* CI/CD Automation \ No newline at end of file From 6aecb3c91264fcf5e17c2f7dc0a8009ddc5c946b Mon Sep 17 00:00:00 2001 From: Wiola Date: Mon, 22 Jun 2026 15:29:51 +0200 Subject: [PATCH 5/5] ci: disable kubernetes openapi validation --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d407aa1..36c9926 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: - name: Build frontend run: npm run build - + infrastructure: name: Docker and Kubernetes Validation runs-on: ubuntu-latest @@ -74,4 +74,4 @@ jobs: run: docker build -t kmeans-frontend ./frontend - name: Validate Kubernetes manifests - run: kubectl apply --dry-run=client -f k8s/ \ No newline at end of file + run: run: kubectl apply --dry-run=client --validate=false -f k8s/ \ No newline at end of file