Expand testbed: add unit + addon-unit suites; fork-agnostic CI #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Interface Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| gramps_repo: | |
| description: 'gramps repo (owner/name); empty = same-owner fork' | |
| default: '' | |
| gramps_ref: | |
| description: 'gramps branch/tag/sha' | |
| default: 'maintenance/gramps60' | |
| 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 | |
| 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). | |
| - 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 || vars.GRAMPS_REF || 'maintenance/gramps60' }} | |
| 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: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| 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: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| 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: | |
| name: test-results | |
| path: | | |
| gramps-testbed/test-results/ | |
| artifacts/ | |
| - name: Publish test report | |
| if: always() | |
| uses: dorny/test-reporter@v1 | |
| with: | |
| name: Interface Tests | |
| path: gramps-testbed/test-results/*.xml | |
| reporter: java-junit |