From 5e6c63b0f8705294db51047cd3e040c536f62a9d Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 24 Nov 2025 20:41:09 -0500 Subject: [PATCH] Run tests in parallel and remove duplicate test runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .github/workflows/fly-deploy.yml | 31 +++------------ .github/workflows/test.yml | 67 ++++++++++++++++---------------- 2 files changed, 40 insertions(+), 58 deletions(-) diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml index 496f429..b059be0 100644 --- a/.github/workflows/fly-deploy.yml +++ b/.github/workflows/fly-deploy.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63a662e..bf1a35a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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