CI: custom runner-base image, Node 22, pip caching

- infra/Dockerfile.runner-base: new Ubuntu 24.04 image with Python 3.12
  and Node 22 LTS pre-installed, tagged py3.12-node22. Eliminates the
  ~3-4 min deadsnakes PPA install that ran on every test job.
- infra/runner-compose.yml: update ubuntu-latest label to use
  runner-base:py3.12-node22 instead of node:20-bullseye.
- .forgejo/workflows/ci.yml: remove Python 3.12 install steps (now in
  base image), add actions/cache for pip keyed on pyproject.toml hash,
  bump node-version 20 → 22.
- Dockerfile: bump frontend build stage node:20-alpine → node:22-alpine.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Bryan Van Deusen
2026-03-10 10:45:59 -04:00
parent f5bee4573f
commit dc03d71898
4 changed files with 34 additions and 13 deletions
+8 -11
View File
@@ -45,7 +45,7 @@ jobs:
- uses: actions/setup-node@v6
with:
node-version: "20"
node-version: "22"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
@@ -75,16 +75,13 @@ jobs:
steps:
- uses: actions/checkout@v6
# The act runner base image ships Ubuntu 22.04 with Python 3.10.
# Our package requires 3.12, so install it from the deadsnakes PPA.
- name: Install Python 3.12
run: |
apt-get update -qq
apt-get install -y -qq software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update -qq
apt-get install -y -qq python3.12 python3.12-dev python3.12-venv python3-pip git
python3.12 -m ensurepip --upgrade
# Python 3.12 is pre-installed in the runner-base image (py3.12-node22).
- name: Cache pip wheels
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('pyproject.toml') }}
restore-keys: pip-
- name: Create virtual environment
run: python3.12 -m venv /opt/venv