|
| 1 | +# CI/CD Setup for Locator |
| 2 | + |
| 3 | +This repository uses GitHub Actions for continuous integration and deployment. |
| 4 | + |
| 5 | +## Workflows |
| 6 | + |
| 7 | +### 1. Tests (`.github/workflows/test.yml`) |
| 8 | +- **Triggers**: Push and pull requests to main/develop branches |
| 9 | +- **Python versions**: 3.9, 3.10, 3.11 |
| 10 | +- **Features**: |
| 11 | + - Parallel test execution with pytest-xdist (`-n auto`) |
| 12 | + - Coverage reporting with pytest-cov |
| 13 | + - CPU-only mode (no GPU required) |
| 14 | + - Dependency caching for faster runs |
| 15 | + - Code linting with black, isort, and flake8 |
| 16 | + |
| 17 | +### 2. Documentation (`.github/workflows/docs.yml`) |
| 18 | +- Builds Sphinx documentation |
| 19 | +- Checks for documentation warnings |
| 20 | +- Uploads built docs as artifacts |
| 21 | + |
| 22 | +### 3. Publishing (`.github/workflows/publish.yml`) |
| 23 | +- Triggered on GitHub releases |
| 24 | +- Publishes to PyPI and Test PyPI |
| 25 | +- Requires secrets: `PYPI_API_TOKEN`, `TEST_PYPI_API_TOKEN` |
| 26 | + |
| 27 | +### 4. Manual Testing (`.github/workflows/manual-test.yml`) |
| 28 | +- Allows manual workflow triggers |
| 29 | +- Configurable Python version and test patterns |
| 30 | + |
| 31 | +## Local Testing |
| 32 | + |
| 33 | +Run tests locally with parallel execution: |
| 34 | +```bash |
| 35 | +# Run all tests in parallel |
| 36 | +pytest -n auto |
| 37 | + |
| 38 | +# Run with 4 workers |
| 39 | +pytest -n 4 |
| 40 | + |
| 41 | +# Run without GPU (recommended) |
| 42 | +CUDA_VISIBLE_DEVICES=-1 pytest -n auto |
| 43 | + |
| 44 | +# Run specific test file |
| 45 | +pytest tests/test_verbosity_control.py -n auto |
| 46 | + |
| 47 | +# Run with coverage |
| 48 | +pytest -n auto --cov=locator --cov-report=html |
| 49 | +``` |
| 50 | + |
| 51 | +## Configuration |
| 52 | + |
| 53 | +- **pytest configuration**: See `pyproject.toml` |
| 54 | +- **Coverage settings**: See `pyproject.toml` |
| 55 | +- **Dependabot**: See `.github/dependabot.yml` |
| 56 | + |
| 57 | +## Required Secrets (for publishing) |
| 58 | + |
| 59 | +Set these in your GitHub repository settings: |
| 60 | +- `CODECOV_TOKEN` (optional, for private repos) |
| 61 | +- `PYPI_API_TOKEN` (for PyPI publishing) |
| 62 | +- `TEST_PYPI_API_TOKEN` (for Test PyPI publishing) |
| 63 | + |
| 64 | +## Status Badges |
| 65 | + |
| 66 | +Add these to your README.md: |
| 67 | +```markdown |
| 68 | +[](https://github.com/YOUR_USERNAME/relocator/actions/workflows/test.yml) |
| 69 | +[](https://codecov.io/gh/YOUR_USERNAME/relocator) |
| 70 | +``` |
0 commit comments