Skip to content

Commit 9453d99

Browse files
eduralphclaude
andcommitted
Add branch-neutral CI infrastructure (mirrors PR 820 work, branch-derived)
Bootstrap of the CI pipeline on maintenance/gramps61. The .github/ workflows, Dockerfile, and shared tests/ harness are the same shape as PR 820 (gramps-project#820) and its follow-ups (gramps-project#820 commits c6aa10e, 8d2654a, 28febdc, 715e71d, dd0fd38, 205b21c, f5907af, ff215ac), restructured so the image tag, make.py argument, and Gramps pip pin are all derived from the branch ref at runtime — same files run unchanged on maintenance/gramps60, maintenance/gramps61, and any future maintenance/grampsNN branch. This commit lands the branch-neutral form directly on maintenance/ gramps61 instead of cherry-picking the gramps60 form and the branch-neutral patches on top, because gramps61 has no prior CI infrastructure to preserve. Verified locally: - python3 -c "import yaml; yaml.safe_load(...)" on both workflow files - bash dry-run of ci.yml setup-job derivation: gramps61 → suffix= 'gramps61', ci_image='ghcr.io/<repo>/gramps-ci:gramps61' - bash dry-run of docker-build params: gramps61 → series=6.1 - docker build --check --build-arg GRAMPS_SERIES=6.0 → no warnings - GRAMPS_SERIES guard fails the build loudly when the arg is unset First-push expectation on this branch: docker-build and ci queue together; ci's container jobs fail pulling the not-yet-pushed image on the first run; re-run after docker-build finishes (~5 min cold) and the image is available. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fcdef0c commit 9453d99

7 files changed

Lines changed: 1016 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# .github/docker/gramps-ci/Dockerfile
2+
#
3+
# Gramps CI image. The Gramps minor series (6.0, 6.1, …) is picked at
4+
# build time via the GRAMPS_SERIES build arg, so the same Dockerfile
5+
# produces gramps-ci:gramps60, gramps-ci:gramps61, … without per-branch
6+
# edits. Includes everything jobs need:
7+
# - Python + pip-installed Gramps, PyGObject, pycairo
8+
# - GTK typelibs (so addon modules that `from gi.repository import Gtk`
9+
# at module load time are importable — widgets still need xvfb to render)
10+
# - intltool/gettext/git for make.py builds
11+
# - ruff, dbf for lint/test tooling (tests use stdlib unittest per AGENTS.md)
12+
# - xvfb + xauth for tests that actually render (wrap with `xvfb-run`)
13+
#
14+
# No display server runs by default — the image is headless unless a command
15+
# explicitly invokes `xvfb-run`. When running with docker locally, pass
16+
# `--init` (or use a container runtime that injects tini) because xvfb-run
17+
# hangs if it inherits PID 1.
18+
#
19+
# Local build:
20+
# docker build --build-arg GRAMPS_SERIES=6.0 .github/docker/gramps-ci
21+
#
22+
ARG PYTHON_VERSION=3.12
23+
FROM python:${PYTHON_VERSION}-slim
24+
25+
# Gramps minor series to install (e.g. 6.0, 6.1). No default — must be
26+
# passed explicitly so a wrong default cannot silently produce an image
27+
# for the wrong Gramps series. docker-build.yml derives this from the
28+
# branch ref.
29+
ARG GRAMPS_SERIES
30+
RUN [ -n "$GRAMPS_SERIES" ] || { echo "GRAMPS_SERIES is required (e.g. 6.0)"; exit 1; }
31+
32+
LABEL org.opencontainers.image.source="https://github.com/gramps-project/addons-source"
33+
LABEL org.opencontainers.image.description="Gramps ${GRAMPS_SERIES} CI image (Python, Gramps, GTK typelibs, xvfb)"
34+
35+
RUN apt-get update && apt-get install -y --no-install-recommends \
36+
libgirepository-2.0-dev \
37+
gir1.2-glib-2.0 \
38+
gir1.2-gtk-3.0 \
39+
gir1.2-pango-1.0 \
40+
gir1.2-gdkpixbuf-2.0 \
41+
gir1.2-atk-1.0 \
42+
gcc \
43+
pkg-config \
44+
python3-dev \
45+
libcairo2-dev \
46+
intltool \
47+
gettext \
48+
git \
49+
xvfb \
50+
xauth \
51+
&& rm -rf /var/lib/apt/lists/*
52+
53+
RUN pip install --no-cache-dir \
54+
PyGObject \
55+
pycairo \
56+
"gramps==${GRAMPS_SERIES}.*" \
57+
orjson \
58+
ruff \
59+
dbf
60+
61+
RUN apt-get purge -y gcc python3-dev pkg-config && apt-get autoremove -y
62+
63+
RUN python -c "from gramps.gen.const import VERSION; print('Gramps', VERSION)" \
64+
&& python -c "import gi; gi.require_version('Gtk', '3.0'); from gi.repository import Gtk; print('GTK OK')"
65+
66+
WORKDIR /workspace

.github/environment.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: addons-ci
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.12
6+
- pygobject
7+
- gtk3
8+
- pip
9+
- pip:
10+
- "gramps>=6.0,<6.1"
11+
- orjson
12+
- dbf

0 commit comments

Comments
 (0)