11# GitHub Actions Workflows
22
3- This directory contains GitHub Actions workflows for automated testing and code quality checks.
3+ This directory contains GitHub Actions workflows for automated testing, code quality checks, and releases .
44
55## Workflows
66
@@ -10,8 +10,8 @@ This directory contains GitHub Actions workflows for automated testing and code
1010- ** Matrix** : Python 3.10, 3.12
1111- ** Purpose** : Run comprehensive test suite with coverage reporting
1212- ** Features** :
13- - Automatic git submodule initialization for ` bluetooth_sig ` dependency
14- - Test execution with pytest and coverage reporting (76% coverage )
13+ - Automatic git submodule initialisation for ` bluetooth_sig ` dependency
14+ - Test execution with pytest and coverage reporting (85% threshold )
1515 - Coverage upload to Codecov for Python 3.12 runs
1616 - Uses project configuration from ` pyproject.toml `
1717
@@ -23,9 +23,18 @@ This directory contains GitHub Actions workflows for automated testing and code
2323- ** Tools** :
2424 - ** ruff** : Formatting and linting
2525 - ** mypy** : strict for production code, lenient for tests/examples
26-
2726- ** Environment Setup** : All tools run via ` python -m ` to ensure proper configuration loading
2827
28+ ### Release (` release.yml ` )
29+
30+ - ** Trigger** : Push of a ` v*.*.* ` tag (e.g. ` v0.1.0 ` )
31+ - ** Purpose** : Build, publish to PyPI, and create a GitHub Release
32+ - ** Jobs** :
33+ 1 . ** build** — builds sdist + wheel using ` hatchling ` , verifies with ` twine check `
34+ 2 . ** publish-pypi** — publishes to PyPI via trusted publisher (OIDC). Requires the ` pypi ` GitHub environment.
35+ 3 . ** github-release** — generates release notes with ` git-cliff ` and creates a GitHub Release with the distribution artefacts.
36+ - ** Prerequisites** : The repository must have a ` pypi ` environment configured with PyPI trusted publisher credentials.
37+
2938## Local Development
3039
3140To run the same checks locally:
@@ -34,17 +43,18 @@ To run the same checks locally:
3443# Install development dependencies
3544pip install -e " .[dev]"
3645
37- # Initialize git submodules (required for UUID registry)
46+ # Initialise git submodules (required for UUID registry)
3847git submodule update --init --recursive
3948
4049# Run tests with coverage
41- python -m pytest tests/ --cov=src/ble_gatt_device --cov-report=term-missing
50+ python -m pytest tests/ --cov=src/bluetooth_sig --cov-report=term-missing
51+
52+ # Run linting
53+ python -m ruff check src/ tests/
54+ python -m ruff format --check src/ tests/
4255
43- # Run linting tools (use python -m for proper configuration loading)
44- python -m flake8 src/ tests/ --count --statistics
45- python -m black --check --diff src/ tests/
46- python -m isort --check-only --diff src/ tests/
47- python -m pylint src/ble_gatt_device/ --exit-zero --score y
56+ # Run type checking
57+ python -m mypy src/bluetooth_sig/
4858```
4959
5060## Environment Setup Requirements
@@ -54,21 +64,18 @@ python -m pylint src/ble_gatt_device/ --exit-zero --score y
5464When testing locally or in agent environments, ensure:
5565
56661 . ** Python 3.11+** is available
57- 1 . ** Git submodules** are initialized : ` git submodule update --init --recursive `
67+ 1 . ** Git submodules** are initialised : ` git submodule update --init --recursive `
58681 . ** Package installation** in development mode: ` pip install -e ".[dev]" `
59691 . ** Tool execution** via Python modules: Use ` python -m tool_name ` instead of direct commands
60- 1 . ** Configuration loading** : flake8-pyproject allows flake8 to read from ` pyproject.toml `
6170
6271### Key Environment Dependencies
6372
6473- Git submodule ` bluetooth_sig ` must be present for UUID registry functionality
65- - All linting tools should be run via ` python -m ` to ensure proper configuration loading
66- - Black handles most formatting that would trigger flake8 style errors
74+ - All linting/formatting is handled by ` ruff ` — configured in ` pyproject.toml `
6775
6876## Notes
6977
70- - All tool configurations are defined in ` pyproject.toml ` (no separate ` .flake8 ` file)
71- - Workflows use ` --exit-zero ` for pylint to prevent CI failures on minor issues
72- - Coverage reporting is optional and won't fail the build
73- - Git submodules are automatically initialized for the Bluetooth SIG UUID registry dependency
78+ - All tool configurations are defined in ` pyproject.toml `
79+ - Coverage threshold is 85% (` --cov-fail-under=85 ` )
80+ - Git submodules are automatically initialised for the Bluetooth SIG UUID registry dependency
7481- Use ` python -m ` prefix for all tools to ensure proper package and configuration loading
0 commit comments