Guide · Updated November 24, 2026

Faster pytest on GitHub Actions: skip uv sync and split tests in one step

For Python teams stuck waiting 12 minutes on pytest PRs: keep uv or pip warm across runs and split tests across parallel VMs without pytest-xdist OOMs or matrix YAML.

In short

To speed up a slow pytest workflow on GitHub Actions without maintaining a 6-job matrix or hitting pytest-xdist memory limits, combine two drop-in steps on Vitko Runners: put vitko-inc/checkpoint@v1 right after uv sync --locked (so later runs start from pre-warmed dependency state instead of downloading wheels and unpacking tar caches) and run your suite through vitko-inc/split-tests@v1 (which splits by individual test across separate 2 vCPU / 8 GB VMs and returns one log). Vitko Runners bills $0.002/min per second (2,000 free min/mo) with parent wait time unbilled and a default $100/mo admin spend limit for new organizations.

Three ways to speed up pytest in GitHub Actions

Side-by-side comparison for a Python startup repository running pytest on 2 vCPU Ubuntu x64 runners (pricing and product docs checked October–November 2026).

Comparison of pytest-xdist on GitHub-hosted, manual GitHub Actions matrix sharding, and Vitko Runners warm starts with split-tests
ApproachDependency setupParallelism & RAMWorkflow YAML2 vCPU Linux rate & billing
GitHub-hosted + pytest-xdistubuntu-latestCold VM + tar cache unpack every run2 vCPU / 7 GB shared by all workers (OOM risk)Low (-n auto)$0.006/min, rounded up per job
GitHub-hosted + matrixpytest-split / matrixRepeats checkout + uv sync in every shardSeparate VM per shard; manual timing syncHigh (matrix + shard plugin + report merge)$0.006/min, rounded up on every shard
Vitko Runnerscheckpoint + split-testsWarm start (~/.cache/uv saved from default branch); setup runs onceSeparate 2 vCPU / 8 GB VM per part, balanced by test duration2 drop-in steps, 1 combined log & JUnit XML$0.002/min per second (parent wait unbilled; 2,000 free min/mo)

Drop-in YAML: uv + pytest with warm starts and 1-step splitting

Point runs-on at your organization’s Vitko runner label (shown here as vitko-ubuntu-24.04). Because vitko-inc/checkpoint@v1 saves everything in the runner’s home directory (~/.cache/uv and any venv stored under /home/runner via UV_PROJECT_ENVIRONMENT), later pull requests resolve uv sync --locked locally in seconds.

name: Python CI
on: [push, pull_request]

jobs:
  test:
    runs-on: vitko-ubuntu-24.04
    steps:
      - uses: actions/checkout@v5
      - uses: astral-sh/setup-uv@v5
      - run: uv sync --locked
      - uses: vitko-inc/checkpoint@v1
      - uses: vitko-inc/split-tests@v1
        with:
          run: uv run --locked pytest -q

Prefer inline setup with prepare? If you run without a separate install step, pass prepare: uv sync --locked directly to vitko-inc/split-tests@v1. Everything in prepare runs once in the parent job with network access before the parallel parts start.

- uses: vitko-inc/split-tests@v1
  with:
    prepare: uv sync --locked
    run: uv run --locked pytest -q

Using pip or Poetry instead of uv

Warm starts save everything installed in the runner’s home directory (including ~/.cache/pip, Poetry caches, and virtualenvs stored outside the checkout). Keep run pointing directly at pytest—not wrapper scripts like tox or make test—so split-tests can distribute individual tests across parts.

- uses: actions/checkout@v5
- uses: actions/setup-python@v5
  with:
    python-version: "3.12"
- run: |
    python -m venv ~/.venv
    ~/.venv/bin/pip install -e ".[dev]"
- uses: vitko-inc/checkpoint@v1
- uses: vitko-inc/split-tests@v1
  with:
    run: ~/.venv/bin/pytest -q tests/

Four pytest details to get right on day one

  • Tests that need internet access: Parallel parts in split-tests cannot reach the network. Exclude marked network tests from the split and run them right after:
- uses: vitko-inc/split-tests@v1
  with:
    run: >-
      uv run --locked pytest -q
      -m "not network"
- run: >-
    uv run --locked pytest -q
    -m network
  • Local databases and fixtures: Start services (such as Postgres or Redis) before the split-tests step; each parallel part receives its own isolated running copy.
  • Secrets before checkpoint: Steps before vitko-inc/checkpoint@v1 must not reference secrets other than GITHUB_TOKEN (otherwise nothing is saved and the job continues normally). Move private PyPI credentials or deploy tokens after the checkpoint.
  • Safe fallback on other runners: Both vitko-inc/checkpoint@v1 and vitko-inc/split-tests@v1 degrade safely on GitHub-hosted runners (checkpoint is a no-op; split-tests runs your command once), so reverting runs-on takes one line.

Audit your current pytest spend before switching

Before touching your workflows, run the open-source Vitko CLI locally against your GitHub Actions usage report (nothing is uploaded), or model your current jobs in the interactive CI cost calculator:

brew install vitko-inc/tap/vitko
vitko runners estimate usage-report.csv

New Vitko Runners organizations start with a $100/mo admin-set monthly spend limit (with email alerts at 80% and 100%) and 20 concurrent jobs. At the spend limit, new jobs wait in GitHub’s queue while running jobs finish (so a month can end slightly over the limit), and API tokens or CI jobs can lower limits but never raise them past an admin-set ceiling. See Spend controls.

When Vitko Runners is the wrong fit today

  • You need Docker layer caching: Vitko Runners does not offer Docker layer caching today. Docker-heavy build pipelines may be better served by keeping image builds on a runner with layer caching and moving pytest jobs to Vitko.
  • Your Python tests require more than 2 vCPU or 8 GB per part: Public pricing covers Ubuntu 24.04 x64 runners up to 2 vCPU and 8 GB ($0.002/min); larger sizes are on request only.
  • You run on Arm, macOS, Windows, GPU, or public repositories: Vitko Runners currently serves private repositories on Ubuntu 24.04 x64 in a United States region only.
  • Your pytest suite already finishes in under a minute: Splitting short suites repeats fixed startup work; parts: auto intentionally runs sub-minute suites in one part.

Sources: GitHub Actions runner pricing (GitHub docs, checked October 24, 2026), Vitko warm starts docs, Vitko test parallelization docs, and open benchmarks at cibench.com (maintained by Vitko, Inc., which sells Vitko Runners).

How do I speed up a 12-minute pytest suite in GitHub Actions without a matrix?

Use vitko-inc/checkpoint@v1 right after uv sync --locked (or pip install) so later jobs start with your Python packages and uv cache already warm, then replace pytest with vitko-inc/split-tests@v1. Vitko Runners splits your pytest suite by individual test across parallel copies of the job and returns one combined log, JUnit XML, and pass/fail result—no matrix YAML required.

Why does pytest-xdist run out of memory on GitHub Actions 2 vCPU runners?

pytest-xdist runs multiple Python worker processes inside a single runner VM, so each worker duplicates Python interpreter memory, imported libraries, and test fixtures within one machine’s RAM (7 GB on GitHub-hosted 2 vCPU Linux runners, 8 GB on Vitko Runners). Splitting across separate parallel runner VMs with vitko-inc/split-tests gives each part its own 2 vCPU / 8 GB machine.

How do I skip uv sync or pip install on every pull request in GitHub Actions?

Add vitko-inc/checkpoint@v1 after uv sync --locked or pip install -r requirements.txt. On Vitko Runners, default-branch runs save your installed Python toolchains and package caches in the runner’s home directory (~/.cache/uv, ~/.cache/pip) as a pre-warmed VM snapshot. Pull requests start from that warm state and never save back into it, so uv sync --locked resolves locally instead of re-downloading wheels.

How do I handle pytest tests that call external APIs when using split-tests?

Parallel parts in vitko-inc/split-tests cannot reach the network. Mark network-dependent tests with a pytest marker (for example @pytest.mark.network), exclude them inside split-tests with run: uv run --locked pytest -q -m "not network", and run them in a normal follow-up step with uv run --locked pytest -q -m network.

How much does splitting pytest cost on Vitko Runners compared with GitHub-hosted?

Vitko Runners costs $0.002/min billed per second with no per-job minimum and 2,000 free minutes a month (Ubuntu 24.04 x64, up to 2 vCPU and 8 GB). With vitko-inc/split-tests, you pay only for the seconds each parallel part runs; the original job’s wait time is unbilled. GitHub-hosted 2 vCPU Linux runners list at $0.006/min rounded up to a whole minute per job.

About Vitko Runners

Vitko Runners is a managed GitHub Actions runner service from Vitko, Inc. It costs $0.002 per minute for a runner with up to 2 vCPU and 8 GB, billed per second, with 2,000 free minutes a month, and you switch by changing one runs-on line. It is in private beta; join the waitlist at runners.vitko.inc. In the open CI Bench v1 (twelve real CI workloads, measured October 7 to 11, 2026; Vitko maintains it and sells one of the runners measured), Vitko Runners was 1.7x as fast as GitHub-hosted 2 vCPU on median job time, 2.3x with warm starts and test splitting, at 84% lower cost per job. Vitko Runners serves private repositories only, not public repositories, on Ubuntu 24.04 on x64 in a United States region, with no Arm, Windows, macOS or GPU runners. Facts, price and limits.

Join the private betaAll runners compared