ci: add GitHub Actions workflow
- Add .github/workflows/ci.yml with pytest, coverage, linting, and type checking - Test on Python 3.11 and 3.12 - Exclude slow tests by default - Upload coverage reports as artifacts - Add CI/CD documentation to AGENTS.md
This commit is contained in:
@@ -350,4 +350,44 @@ video_url|anime_page_url|episode_title
|
||||
- `pytest-cov` - Coverage reporting
|
||||
- `pytest-mock` - Mocking utilities
|
||||
- `pytest-timeout` - Test timeout protection
|
||||
- `pytest-html` - HTML test reports
|
||||
- `pytest-html` - HTML test reports
|
||||
|
||||
|
||||
## CI/CD
|
||||
|
||||
### GitHub Actions
|
||||
|
||||
This project uses GitHub Actions for continuous integration. The workflow is defined in `.github/workflows/ci.yml`.
|
||||
|
||||
**Workflow Features:**
|
||||
- Runs on push and pull requests to `main` and `dev` branches
|
||||
- Tests on Python 3.11 and 3.12
|
||||
- Excludes slow tests by default (`-m "not slow"`)
|
||||
- Generates HTML coverage reports
|
||||
- Runs linting with ruff
|
||||
- Runs type checking with mypy
|
||||
|
||||
**Artifacts:**
|
||||
- Coverage reports are uploaded as artifacts after each run
|
||||
- Access via the "Actions" tab on GitHub
|
||||
|
||||
**Running locally:**
|
||||
```bash
|
||||
# Run tests (excluding slow tests)
|
||||
pytest -m "not slow" --cov=app --cov-report=html
|
||||
|
||||
# Run all tests including slow ones
|
||||
pytest
|
||||
|
||||
# Run only unit tests
|
||||
pytest -m "unit"
|
||||
|
||||
# Run only integration tests
|
||||
pytest -m "integration"
|
||||
|
||||
# Run linting
|
||||
pip install ruff && ruff check app/
|
||||
|
||||
# Run type checking
|
||||
pip install mypy && mypy app/
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user