Python
Python CI on GitHub Actions
pip install takes minutes and pytest runs on a single core.
180s → 12s
Install
14m → 3m
Test suite
1 → 8
Cores used
pip install takes minutes and pytest runs on a single core.
Why it happens
Wheels are resolved and often compiled on every run, and pytest is serial unless you tell it otherwise.
What to change
- Switch to uv — resolution and install are typically 10–30× faster than pip
- Cache the virtualenv keyed on the lockfile, not just the pip HTTP cache
- Run pytest -n auto with pytest-xdist to use every core on the runner
- Split slow integration tests into their own job so unit feedback stays fast
Python on runnerhut
yaml
jobs: test: runs-on: runnerhut-8vcpu-ubuntu-2404 steps: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v5 with: { enable-cache: true } - run: uv sync --frozen - run: uv run pytest -n auto --dist loadgroupThe only runnerhut-specific line is `runs-on: runnerhut-8vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.