mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
6994d96f94
New workflow: test.yml - Runs on push to main and all pull requests - Executes full test suite with pytest - Generates coverage report - Includes optional code quality checks Updated workflow: fly-deploy.yml - Added test job that runs before deployment - Deploy only happens if all tests pass - Prevents deploying broken code to production Updated dependencies: - Added pytest-cov for coverage reporting in CI The test suite (100+ tests) now runs automatically: - On every push to main - On every pull request - Before every deployment to Fly.io This ensures code quality and prevents regressions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
1.1 KiB
YAML
57 lines
1.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
name: Run Test Suite
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v5
|
|
with:
|
|
version: "latest"
|
|
|
|
- name: Set up Python
|
|
run: uv python install 3.13
|
|
|
|
- name: Install dependencies
|
|
run: uv sync
|
|
|
|
- name: Run tests
|
|
run: uv run pytest tests/ -v --tb=short
|
|
|
|
- name: Run tests with coverage
|
|
run: uv run pytest tests/ --cov=kjvstudy_org --cov-report=term-missing
|
|
|
|
lint:
|
|
name: Code Quality
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v5
|
|
with:
|
|
version: "latest"
|
|
|
|
- name: Set up Python
|
|
run: uv python install 3.13
|
|
|
|
- name: Install dependencies
|
|
run: uv sync
|
|
|
|
- name: Check code formatting with ruff (if available)
|
|
run: uv run ruff check . || echo "Ruff not configured, skipping"
|
|
continue-on-error: true
|