ci: speed up python-package.yml from ~13min to ~3-4min #15

Merged
admin merged 7 commits from hermes/brencher:feat/optimize-ci-build-time into main 2026-09-04 09:48:31 +02:00
7 Commits
Author SHA1 Message Date
hermes 43b5afaf94 ci: retrigger after comment cleanup
Python package / build (3.12.3) (pull_request) Successful in 4m17s
Python package / build (3.13) (pull_request) Successful in 2m15s
Python package / build (3.14) (pull_request) Successful in 2m28s
2026-09-04 07:31:40 +00:00
admin e3bc8a3212 Merge branch 'main' into feat/optimize-ci-build-time
Python package / build (3.12.3) (pull_request) Successful in 10m47s
Python package / build (3.13) (pull_request) Successful in 10m50s
Python package / build (3.14) (pull_request) Successful in 10m53s
2026-09-04 08:30:58 +02:00
hermes 0cb62d233a ci: trim explanatory comments from python-package.yml
Python package / build (3.12.3) (pull_request) Successful in 2m17s
Python package / build (3.13) (pull_request) Failing after 11m17s
Python package / build (3.14) (pull_request) Canceled after 11m58s
Drop the CI-history and per-option narration comments; keep only what is
needed for the workflow to be readable (job names, step names). Mirrors
the repo's compose/env/entrypoint-with-no-explanatory-comments style.
2026-09-04 06:15:05 +00:00
hermes ac682c1a92 ci: retrigger after run #58 success
Python package / build (3.12.3) (pull_request) Successful in 2m10s
Python package / build (3.13) (pull_request) Successful in 2m12s
Python package / build (3.14) (pull_request) Successful in 2m22s
2026-09-03 21:43:42 +00:00
hermes 0bbb3c4c26 ci: retrigger after runner cache register fix
Python package / build (3.12.3) (pull_request) Successful in 3m45s
Python package / build (3.13) (pull_request) Successful in 2m11s
Python package / build (3.14) (pull_request) Successful in 2m18s
2026-09-03 21:17:35 +00:00
hermes c6af53ec7e ci: empty commit to retrigger cache verification run
Python package / build (3.12.3) (pull_request) Canceled after 0s
Python package / build (3.13) (pull_request) Canceled after 0s
Python package / build (3.14) (pull_request) Canceled after 0s
2026-09-03 20:42:40 +00:00
hermes db3807e49a ci: speed up python-package.yml from ~13min to ~3-4min
Python package / build (3.12.3) (pull_request) Successful in 12m41s
Python package / build (3.13) (pull_request) Successful in 11m13s
Python package / build (3.14) (pull_request) Successful in 11m18s
The build job was running for ~13 minutes per PR even with tests
disabled (per PR #13). The actual cause: the matrix had
3 python-versions x 5 checkers = 15 separate CI jobs, each
re-installing the same requirements.txt + requirements-dev.txt
from scratch with no pip cache.

This commit:
  1. Enables pip caching via actions/setup-python@v5 cache: 'pip'
     keyed on the contents of requirements.txt and requirements-dev.txt.
     When those files don't change, pip install is near-instant.
     When they do change, only the diff downloads.

  2. Drops two debug-only matrix entries that were never real checks:
       python -c 'import sys; print(...)'  (debug)
       pip list                          (debug)
     They took up two of the five matrix cells but produced no
     actionable signal.

  3. Restructures the matrix so each Python version runs ONE job
     that does install + flake8 (2 invocations) + mypy sequentially,
     instead of one job per (version, checker) pair. Net: 3 jobs
     total instead of 15.

  4. Adds a concurrency: cancel-in-progress block so a new push
     to the same PR auto-cancels the previous in-flight run,
     saving runner minutes when iterating on a fix.

Verified:
  - YAML parses via PyYAML
  - jobs dict contains ['build'] only
  - matrix python versions: ['3.12.3', '3.13', '3.14']
  - total CI jobs: 3 (was 15)
  - actions/setup-python@v5 with cache: 'pip' + cache-dependency-path
    on requirements.txt and requirements-dev.txt

Expected wall-clock (rough estimate, depends on cache hits):
  Before: ~13 min (15 jobs, no pip cache, install on every job)
  After (cold): ~5-7 min (3 jobs, pip cache miss on first run)
  After (warm): ~3-4 min (3 jobs, pip cache hits)

If caching doesn't activate (e.g. self-hosted runner ignores cache:),
the win comes mostly from 15 -> 3 jobs (~5x faster).

Note: PR #14 (re-enable tests) is still open. If/when it merges, this
PR will need a follow-up to re-add the tests job with the same
cache setup applied.
2026-08-25 22:10:30 +00:00