Add versioning strategy and CI/CD pipeline
Some checks failed
CI / Lint (push) Failing after 2m51s
CI / Type Check (push) Failing after 32s
CI / Test (push) Failing after 37s
CI / Release (push) Has been skipped

- Add semantic versioning section to development plan
- Map sprint milestones to version tags
- Create Gitea Actions CI workflow (lint, typecheck, test, release)
- Add CHANGELOG.md following Keep a Changelog format
This commit is contained in:
2025-12-01 23:42:41 +00:00
parent afb5bd2075
commit b164252a92
3 changed files with 223 additions and 9 deletions

97
.gitea/workflows/ci.yaml Normal file
View File

@@ -0,0 +1,97 @@
name: CI
on:
push:
branches: [master, main]
tags: ['v*']
pull_request:
branches: [master, main]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff
run: ruff check src/ tests/
typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run mypy
run: mypy src/
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run pytest
run: pytest --cov=src/py_dvt_ate --cov-report=xml
- name: Check coverage
run: |
coverage report --fail-under=80 || echo "Coverage below 80% - will enforce after MVP"
release:
name: Release
needs: [lint, typecheck, test]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true

36
CHANGELOG.md Normal file
View File

@@ -0,0 +1,36 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Project documentation (requirements, technical specification, architecture decisions)
- Development plan with vertical slice approach
- CI/CD pipeline configuration
## [0.0.1] - TBD
### Added
- Initial project scaffolding
- pyproject.toml with dependencies
- Package directory structure
- Development tooling configuration (ruff, mypy, pytest)
- CLI entry point stub
---
## Version History
| Version | Date | Milestone |
|---------|------|-----------|
| 0.1.0 | TBD | MVP Complete |
| 0.1.0-beta.2 | TBD | First DVT test runs |
| 0.1.0-beta.1 | TBD | HAL complete |
| 0.1.0-alpha.3 | TBD | Network ready |
| 0.1.0-alpha.2 | TBD | Visual demo |
| 0.1.0-alpha.1 | TBD | Physics engine |
| 0.0.1 | TBD | Project scaffolding |

View File

@@ -555,17 +555,98 @@ dashboard/app.py → hal/factory.py (Sprint 17, upgraded)
--- ---
## Versioning Strategy
### Semantic Versioning
This project follows [Semantic Versioning 2.0.0](https://semver.org/):
```
MAJOR.MINOR.PATCH[-PRERELEASE]
- MAJOR: Breaking API changes
- MINOR: New features, backwards compatible
- PATCH: Bug fixes, backwards compatible
- PRERELEASE: alpha.N, beta.N, rc.N
```
### Phase 1 Version Progression
| Sprint | Version Tag | Milestone | Release Type |
|--------|-------------|-----------|--------------|
| 1 | `v0.0.1` | Project scaffolding | Internal |
| 3 | `v0.1.0-alpha.1` | Physics engine working | Pre-release |
| 4 | `v0.1.0-alpha.2` | Visual demo (dashboard) | Pre-release |
| 8 | `v0.1.0-alpha.3` | Network ready (TCP server) | Pre-release |
| 11 | `v0.1.0-beta.1` | HAL complete | Pre-release |
| 15 | `v0.1.0-beta.2` | First DVT test runs | Pre-release |
| 17 | `v0.1.0` | **MVP Complete** | Release |
### Tagging Convention
```bash
# After completing a milestone sprint:
git tag -a v0.1.0-alpha.1 -m "Physics engine working"
git push origin v0.1.0-alpha.1
```
### Version Location
The version is defined in **one place** and read elsewhere:
```
src/py_dvt_ate/__init__.py:
__version__ = "0.1.0-alpha.1"
pyproject.toml:
[project]
dynamic = ["version"]
[tool.hatch.version]
path = "src/py_dvt_ate/__init__.py"
```
### CI/CD Pipeline
On every push:
- Run `ruff check` (linting)
- Run `mypy` (type checking)
- Run `pytest` (tests)
On tag push (`v*`):
- All of the above
- Build package
- Create release
### CHANGELOG
Maintain `CHANGELOG.md` following [Keep a Changelog](https://keepachangelog.com/):
```markdown
## [Unreleased]
### Added
- ...
## [0.1.0-alpha.1] - 2025-12-XX
### Added
- Physics engine with thermal-electrical coupling
- LDO DUT model with temperature coefficient
```
---
## Milestone Summary ## Milestone Summary
| Sprint | Milestone | What You Can Demo | | Sprint | Version | Milestone | What You Can Demo |
|--------|-----------|-------------------| |--------|---------|-----------|-------------------|
| 3 | Physics Working | Unit tests prove thermal coupling | | 1 | `v0.0.1` | Scaffolding | Package installs |
| 4 | **Visual Demo!** | Interactive Streamlit showing physics | | 3 | `v0.1.0-alpha.1` | Physics Working | Unit tests prove thermal coupling |
| 7 | Instruments Done | SCPI simulators respond to commands | | 4 | `v0.1.0-alpha.2` | **Visual Demo!** | Interactive Streamlit showing physics |
| 8 | Network Ready | TCP server accepts connections | | 7 | - | Instruments Done | SCPI simulators respond to commands |
| 11 | HAL Complete | Abstraction layer swappable | | 8 | `v0.1.0-alpha.3` | Network Ready | TCP server accepts connections |
| 15 | First Test | TempCo characterisation runs | | 11 | `v0.1.0-beta.1` | HAL Complete | Abstraction layer swappable |
| 17 | **MVP Complete** | Full end-to-end workflow | | 15 | `v0.1.0-beta.2` | First Test | TempCo characterisation runs |
| 17 | `v0.1.0` | **MVP Complete** | Full end-to-end workflow |
--- ---