Skip to content

Commit cc25e3c

Browse files
committed
Phase 14: Complete CI/CD Setup Implementation
✅ GitHub Actions Workflows: - tests.yml: Multi-Python testing (3.8-3.12) with coverage - publish.yml: Automated PyPI publishing on releases - quality.yml: Pre-commit code quality checks ✅ Pre-commit Configuration: - Black code formatting - Flake8 linting - Mypy type checking - Basic file validation hooks ✅ GitHub Repository Configuration: - Dependabot for automated dependency updates - Bug report and feature request issue templates - Comprehensive pull request template - Standardized contribution workflow ✅ CI/CD Features: - Automated testing across Python 3.8-3.12 - Code quality enforcement (Black, flake8, mypy) - Test coverage reporting with Codecov - Trusted PyPI publishing on releases - Dependency security updates - Standardized issue and PR workflows Complete CI/CD pipeline ready for production deployment with automated testing, quality assurance, and publishing.
1 parent 59d440d commit cc25e3c

9 files changed

Lines changed: 304 additions & 22 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Initialize client with '...'
16+
2. Call method '....'
17+
3. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Code sample**
23+
```python
24+
# Minimal code sample that reproduces the issue
25+
from pathao import PathaoClient
26+
27+
client = PathaoClient(...)
28+
# Your code here
29+
```
30+
31+
**Error message**
32+
```
33+
Paste the full error message here
34+
```
35+
36+
**Environment:**
37+
- OS: [e.g. Ubuntu 20.04, macOS 12.0, Windows 10]
38+
- Python version: [e.g. 3.9.7]
39+
- pathao version: [e.g. 0.1.0]
40+
41+
**Additional context**
42+
Add any other context about the problem here.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
21+
22+
**API Reference**
23+
If this relates to a Pathao API feature, please provide:
24+
- API endpoint
25+
- Documentation link
26+
- Expected behavior

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 10
8+
reviewers:
9+
- "yourusername"
10+
assignees:
11+
- "yourusername"
12+
commit-message:
13+
prefix: "deps"
14+
include: "scope"

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Description
2+
Brief description of the changes in this PR.
3+
4+
## Type of Change
5+
- [ ] Bug fix (non-breaking change which fixes an issue)
6+
- [ ] New feature (non-breaking change which adds functionality)
7+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8+
- [ ] Documentation update
9+
- [ ] Code quality improvement
10+
11+
## Testing
12+
- [ ] Tests pass locally
13+
- [ ] New tests added for new functionality
14+
- [ ] Coverage maintained or improved
15+
16+
## Code Quality
17+
- [ ] Code follows the project's style guidelines
18+
- [ ] Self-review of code completed
19+
- [ ] Code is commented, particularly in hard-to-understand areas
20+
- [ ] Corresponding changes to documentation made
21+
22+
## Checklist
23+
- [ ] My code follows the style guidelines of this project
24+
- [ ] I have performed a self-review of my own code
25+
- [ ] I have commented my code, particularly in hard-to-understand areas
26+
- [ ] I have made corresponding changes to the documentation
27+
- [ ] My changes generate no new warnings
28+
- [ ] I have added tests that prove my fix is effective or that my feature works
29+
- [ ] New and existing unit tests pass locally with my changes

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
environment: release
11+
permissions:
12+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.9'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build twine
26+
27+
- name: Build package
28+
run: python -m build
29+
30+
- name: Check package
31+
run: twine check dist/*
32+
33+
- name: Publish package to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1
35+
with:
36+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/quality.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ master, main, develop ]
6+
pull_request:
7+
branches: [ master, main, develop ]
8+
9+
jobs:
10+
quality:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pre-commit
25+
26+
- name: Run pre-commit
27+
run: pre-commit run --all-files

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master, main, develop ]
6+
pull_request:
7+
branches: [ master, main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements-dev.txt
28+
pip install -e .
29+
30+
- name: Lint with flake8
31+
run: |
32+
flake8 pathao tests
33+
34+
- name: Type check with mypy
35+
run: |
36+
mypy pathao
37+
38+
- name: Test with pytest
39+
run: |
40+
pytest --cov=pathao --cov-report=xml --cov-fail-under=80 tests/ --ignore=tests/test_integration.py --ignore=tests/test_integration_sandbox.py
41+
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v3
44+
with:
45+
file: ./coverage.xml
46+
flags: unittests
47+
name: codecov-umbrella
48+
fail_ci_if_error: false

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-merge-conflict
10+
11+
- repo: https://github.com/psf/black
12+
rev: 23.7.0
13+
hooks:
14+
- id: black
15+
language_version: python3
16+
17+
- repo: https://github.com/pycqa/flake8
18+
rev: 6.0.0
19+
hooks:
20+
- id: flake8
21+
22+
- repo: https://github.com/pre-commit/mirrors-mypy
23+
rev: v1.5.1
24+
hooks:
25+
- id: mypy
26+
additional_dependencies: [types-requests]
27+
args: [--config-file=mypy.ini]

pathao_implementation_checklist.md

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -860,31 +860,64 @@ All examples are:
860860

861861
---
862862

863-
## Phase 14: CI/CD Setup
863+
## Phase 14: CI/CD Setup
864864

865865
### 14.1 GitHub Actions
866866

867-
- [ ] **.github/workflows/tests.yml**
868-
- [ ] Runs on push and PR
869-
- [ ] Tests multiple Python versions (3.8-3.12)
870-
- [ ] Runs linting
871-
- [ ] Runs type checking
872-
- [ ] Runs tests with coverage
873-
- [ ] Uploads coverage to codecov
874-
875-
- [ ] **.github/workflows/publish.yml**
876-
- [ ] Triggered on release creation
877-
- [ ] Builds package
878-
- [ ] Publishes to PyPI
879-
- [ ] Requires PyPI token
880-
881-
### 14.2 Pre-commit Hooks (Optional)
882-
883-
- [ ] **.pre-commit-config.yaml**
884-
- [ ] Black formatter
885-
- [ ] Flake8 linter
886-
- [ ] Mypy type checker
887-
- [ ] Other checks
867+
- [x] **.github/workflows/tests.yml**
868+
- [x] Runs on push and PR
869+
- [x] Tests multiple Python versions (3.8-3.12)
870+
- [x] Runs linting (flake8)
871+
- [x] Runs type checking (mypy)
872+
- [x] Runs tests with coverage
873+
- [x] Uploads coverage to codecov
874+
875+
- [x] **.github/workflows/publish.yml**
876+
- [x] Triggered on release creation
877+
- [x] Builds package
878+
- [x] Publishes to PyPI
879+
- [x] Uses PyPI trusted publishing
880+
881+
- [x] **.github/workflows/quality.yml**
882+
- [x] Code quality checks with pre-commit
883+
- [x] Automated formatting and linting
884+
- [x] Type checking validation
885+
886+
### 14.2 Pre-commit Hooks
887+
888+
- [x] **.pre-commit-config.yaml**
889+
- [x] Black formatter
890+
- [x] Flake8 linter
891+
- [x] Mypy type checker
892+
- [x] Basic file checks (trailing whitespace, YAML, etc.)
893+
894+
### 14.3 GitHub Configuration
895+
896+
- [x] **.github/dependabot.yml**
897+
- [x] Automated dependency updates
898+
- [x] Weekly schedule
899+
- [x] Pull request management
900+
901+
- [x] **.github/ISSUE_TEMPLATE/**
902+
- [x] Bug report template
903+
- [x] Feature request template
904+
905+
- [x] **.github/pull_request_template.md**
906+
- [x] Comprehensive PR checklist
907+
- [x] Code quality requirements
908+
- [x] Testing requirements
909+
910+
### 14.4 CI/CD Features
911+
912+
- [x] **Multi-Python version testing** (3.8-3.12)
913+
- [x] **Automated code quality** (Black, flake8, mypy)
914+
- [x] **Test coverage reporting** (Codecov integration)
915+
- [x] **Automated PyPI publishing** (on release)
916+
- [x] **Dependency management** (Dependabot)
917+
- [x] **Issue and PR templates** (standardized contributions)
918+
- [x] **Pre-commit hooks** (local development quality)
919+
920+
**Complete CI/CD pipeline with automated testing, quality checks, and publishing**
888921

889922
---
890923

0 commit comments

Comments
 (0)