A comprehensive demo repository showing Git basics, GitHub collaboration, and GitHub Actions CI/CD with a machine learning project.
This project implements a simple Logistic Regression classifier for the Iris dataset from scikit-learn.
- Data loading and preprocessing
- Logistic Regression model training
- Model evaluation and persistence
- Automated testing with pytest
- Code quality checks with flake8
- CI/CD pipeline with GitHub Actions
- Docker containerization
ml-app/ ├── .github/workflows/ # GitHub Actions workflows ├── src/ # Source code ├── tests/ # Test cases ├── models/ # Trained models ├── requirements.txt # Dependencies └── README.md
Clone repository git clone
Check status git status
Add files to staging git add .
Commit changes git commit -m "Descriptive commit message"
Push to remote git push origin main
Create and switch to new branch git checkout -b feature/new-feature
Merge branches git merge feature/new-feature
text
This repository includes a CI/CD workflow that:
- Runs on push/pull requests to main branch
- Installs dependencies
- Runs flake8 linting
- Executes pytest tests
- Builds Docker image
- Uploads test results and Docker image as artifacts
-
Create virtual environment and install dependencies: python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -r requirements.txt
-
Train the model: python src/train.py
-
Run tests: pytest tests/
-
Run linter: flake8 src/ tests/
The GitHub Actions workflow automatically:
- Checks code quality
- Runs all tests
- Builds Docker container
- Uploads artifacts
See .github/workflows/ci.yml for details.