mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
Run tests in parallel and remove duplicate test runs
- Split test suite into 3 parallel jobs (API, edge cases, web routes) - Change fly-deploy to trigger after Tests workflow succeeds - Remove duplicate test run from deploy workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,36 +2,17 @@
|
||||
|
||||
name: Fly Deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_run:
|
||||
workflows: ["Tests"]
|
||||
branches: [main]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run tests before deploy
|
||||
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
|
||||
|
||||
deploy:
|
||||
name: Deploy app
|
||||
runs-on: ubuntu-latest
|
||||
needs: test # Only deploy if tests pass
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
concurrency: deploy-group # optional: ensure only one action runs at a time
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
+34
-33
@@ -7,50 +7,51 @@ on:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run Test Suite
|
||||
test-api:
|
||||
name: API Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: "latest"
|
||||
- run: uv python install 3.13
|
||||
- run: uv sync
|
||||
- run: uv run pytest tests/test_api.py -v --tb=short
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install 3.13
|
||||
test-edge-cases:
|
||||
name: Edge Case Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: "latest"
|
||||
- run: uv python install 3.13
|
||||
- run: uv sync
|
||||
- run: uv run pytest tests/test_edge_cases.py -v --tb=short
|
||||
|
||||
- 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
|
||||
test-web-routes:
|
||||
name: Web Route Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: "latest"
|
||||
- run: uv python install 3.13
|
||||
- run: uv sync
|
||||
- run: uv run pytest tests/test_web_routes.py -v --tb=short
|
||||
|
||||
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
|
||||
- uses: actions/checkout@v4
|
||||
- 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"
|
||||
- run: uv python install 3.13
|
||||
- run: uv sync
|
||||
- run: uv run ruff check . || echo "Ruff not configured, skipping"
|
||||
continue-on-error: true
|
||||
|
||||
Reference in New Issue
Block a user