-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (162 loc) · 7.02 KB
/
Copy pathinterface-tests.yml
File metadata and controls
179 lines (162 loc) · 7.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Interface Tests
on:
push:
branches: [main]
pull_request:
schedule:
# Nightly drift check at 05:30 UTC — 1.5h after upstream-sync rebases
# the forks at 04:00 UTC. The GUI smoke suite against fresh upstream
# catches Gtk/at-spi/accessibility-tree regressions before a human PR
# lands on them. Staggered 30min after unit-tests.yml to smooth load.
- cron: '30 5 * * *'
workflow_dispatch:
inputs:
gramps_repo:
description: 'gramps repo (owner/name); empty = same-owner fork'
default: ''
gramps_ref:
description: 'gramps branch/tag/sha; empty = matrix defaults'
default: ''
addons_source_repo:
description: 'addons-source repo (owner/name); empty = same-owner fork'
default: ''
addons_ref:
description: 'addons-source branch/tag/sha'
default: 'maintenance/gramps60'
addon_name:
description: 'Single addon to build (empty = all)'
default: ''
jobs:
gui-tests:
runs-on: ubuntu-24.04
timeout-minutes: 30
# Blocking gate. The interface smoke suite is the testbed's primary
# reason to exist (see CLAUDE.md: "Get tests/interface/test_smoke.py
# passing locally and in CI before adding any other tests") — any
# failure must stop a merge. No continue-on-error here, by design.
strategy:
fail-fast: false
matrix:
# Supported Gramps minors. Add new maintenance branches here when
# they exist upstream (e.g. - maintenance/gramps61) — each entry
# produces a parallel job. Kept in sync with unit-tests.yml.
gramps_ref:
- maintenance/gramps60
steps:
- name: Checkout testbed
uses: actions/checkout@v4
with:
path: gramps-testbed
# Repo resolution (in order): workflow input → repository variable
# → same-owner fork (auto-derived from this testbed's owner, so
# forking the testbed to you/gramps-testbed just works if you also
# have you/gramps and you/addons-source). Ref resolution: workflow
# input → matrix cell.
- name: Checkout gramps fork
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.gramps_repo || vars.GRAMPS_REPO || format('{0}/gramps', github.repository_owner) }}
ref: ${{ github.event.inputs.gramps_ref || matrix.gramps_ref }}
path: gramps
- name: Checkout addons-source fork
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.addons_source_repo || vars.ADDONS_SOURCE_REPO || format('{0}/addons-source', github.repository_owner) }}
ref: ${{ github.event.inputs.addons_ref || vars.ADDONS_SOURCE_REF || 'maintenance/gramps60' }}
path: addons-source
- name: Checkout addons (upstream, publish target for make.py)
uses: actions/checkout@v4
with:
repository: gramps-project/addons
path: addons
- name: Install system dependencies
# python3-venv / python3-pip are installed here so the next step
# can build a venv that inherits python3-gi and python3-pyatspi
# from the system interpreter.
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
python3 python3-venv python3-pip \
python3-gi python3-gi-cairo python3-cairo python3-pyatspi python3-icu \
gir1.2-gtk-3.0 gir1.2-osmgpsmap-1.0 gir1.2-goocanvas-2.0 gir1.2-gexiv2-0.10 \
libgirepository1.0-dev \
xvfb dbus-x11 at-spi2-core \
xdotool wmctrl \
gettext intltool \
librsvg2-common
- name: Set up Python venv (inherits python3-gi / python3-pyatspi from apt)
# Ubuntu 24.04's apt python3-gi and python3-pyatspi install into
# the system Python's dist-packages only; a fresh interpreter from
# setup-python@v5 can't see those bindings, and gramps.gen imports
# gi on module load — so every gramps-touching command dies with
# ModuleNotFoundError. dogtail (GUI driver) also requires pyatspi
# at the same interpreter. --system-site-packages keeps pip
# installs in the venv but inherits apt-provided bindings.
# Replaces actions/setup-python@v5; pip cache is restored below
# via actions/cache.
run: |
python3 -m venv --system-site-packages .venv
echo "$GITHUB_WORKSPACE/.venv/bin" >> "$GITHUB_PATH"
.venv/bin/python -m pip install --upgrade pip
- name: Restore pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ hashFiles('gramps-testbed/requirements-test.txt') }}
restore-keys: |
pip-${{ runner.os }}-
- name: Install Python dependencies
run: |
pip install -r gramps-testbed/requirements-test.txt
pip install -e 'gramps[testing]'
- name: Compile Gramps translations
# pip install -e skips setup.py build, so Gramps' build/mo dir is
# empty. Compile .po → .mo directly with msgfmt so launched Gramps
# finds its translations instead of falling back with a warning.
working-directory: gramps
run: |
for po in po/*.po; do
lang=$(basename "$po" .po)
dest="build/mo/$lang/LC_MESSAGES"
mkdir -p "$dest"
msgfmt "$po" -o "$dest/gramps.mo"
done
# Addons are intentionally not built or installed for the smoke suite:
# make.py mutates tracked .gpr.py files, and installing all 149 addons
# blocks Gramps GUI startup during plugin registration. The addon_name
# workflow input remains reserved for a future addon-aware job.
- name: Seed example database
run: |
gramps -C TestTree -i gramps/example/gramps/example.gramps
- name: Run interface tests
working-directory: gramps-testbed
env:
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
run: |
mkdir -p test-results "$ARTIFACTS_DIR/screenshots"
xvfb-run -a --server-args="-screen 0 1920x1080x24" \
dbus-run-session -- bash -c '
gsettings set org.gnome.desktop.interface toolkit-accessibility true
/usr/libexec/at-spi-bus-launcher --launch-immediately &
sleep 2
python -m xmlrunner discover \
-s tests -p "test_*.py" \
-o test-results/ \
-v
'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
# Matrix-scoped artifact name so parallel cells don't collide.
name: test-results-${{ strategy.job-index }}
path: |
gramps-testbed/test-results/
artifacts/
- name: Publish test report
if: always()
uses: dorny/test-reporter@v1
with:
name: Interface Tests (${{ matrix.gramps_ref }})
path: gramps-testbed/test-results/*.xml
reporter: java-junit