|
| 1 | +name: GUI Interface Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + gramps_ref: |
| 10 | + description: 'gramps fork branch/tag/sha' |
| 11 | + default: 'maintenance/gramps60' |
| 12 | + addons_ref: |
| 13 | + description: 'addons-source fork branch/tag/sha' |
| 14 | + default: 'maintenance/gramps60' |
| 15 | + addon_name: |
| 16 | + description: 'Single addon to build (empty = all)' |
| 17 | + default: '' |
| 18 | + |
| 19 | +jobs: |
| 20 | + gui-tests: |
| 21 | + runs-on: ubuntu-24.04 |
| 22 | + timeout-minutes: 30 |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout testbed |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + path: gramps-testbed |
| 29 | + |
| 30 | + - name: Checkout gramps fork |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + repository: eduralph/gramps |
| 34 | + ref: ${{ github.event.inputs.gramps_ref || 'maintenance/gramps60' }} |
| 35 | + path: gramps |
| 36 | + |
| 37 | + - name: Checkout addons-source fork |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + repository: eduralph/addons-source |
| 41 | + ref: ${{ github.event.inputs.addons_ref || 'maintenance/gramps60' }} |
| 42 | + path: addons-source |
| 43 | + |
| 44 | + - name: Checkout addons (upstream, publish target for make.py) |
| 45 | + uses: actions/checkout@v4 |
| 46 | + with: |
| 47 | + repository: gramps-project/addons |
| 48 | + path: addons |
| 49 | + |
| 50 | + - name: Set up Python |
| 51 | + uses: actions/setup-python@v5 |
| 52 | + with: |
| 53 | + python-version: '3.12' |
| 54 | + |
| 55 | + - name: Install system dependencies |
| 56 | + run: | |
| 57 | + sudo apt-get update |
| 58 | + sudo apt-get install -y --no-install-recommends \ |
| 59 | + python3-gi python3-gi-cairo python3-cairo \ |
| 60 | + gir1.2-gtk-3.0 gir1.2-osmgpsmap-1.0 gir1.2-goocanvas-2.0 \ |
| 61 | + libgirepository1.0-dev \ |
| 62 | + xvfb dbus-x11 at-spi2-core \ |
| 63 | + xdotool wmctrl \ |
| 64 | + gettext intltool \ |
| 65 | + librsvg2-common |
| 66 | +
|
| 67 | + - name: Install Python dependencies |
| 68 | + run: | |
| 69 | + python -m pip install --upgrade pip |
| 70 | + pip install -r gramps-testbed/requirements-test.txt |
| 71 | + pip install -e gramps |
| 72 | +
|
| 73 | + - name: Build addons |
| 74 | + working-directory: addons-source |
| 75 | + run: | |
| 76 | + if [ -n "${{ github.event.inputs.addon_name }}" ]; then |
| 77 | + python make.py gramps60 build "${{ github.event.inputs.addon_name }}" |
| 78 | + else |
| 79 | + python make.py gramps60 build all |
| 80 | + fi |
| 81 | +
|
| 82 | + - name: Install addons into user plugin directory |
| 83 | + working-directory: addons-source |
| 84 | + run: | |
| 85 | + mkdir -p ~/.gramps/gramps60/plugins |
| 86 | + for addon in */; do |
| 87 | + [ -f "$addon/${addon%/}.gpr.py" ] && cp -r "$addon" ~/.gramps/gramps60/plugins/ |
| 88 | + done |
| 89 | +
|
| 90 | + - name: Seed example database |
| 91 | + run: | |
| 92 | + gramps -C TestTree -i gramps/example/gramps/example.gramps |
| 93 | +
|
| 94 | + - name: Run interface tests |
| 95 | + working-directory: gramps-testbed |
| 96 | + env: |
| 97 | + ARTIFACTS_DIR: ${{ github.workspace }}/artifacts |
| 98 | + run: | |
| 99 | + mkdir -p test-results "$ARTIFACTS_DIR/screenshots" |
| 100 | + xvfb-run -a --server-args="-screen 0 1920x1080x24" \ |
| 101 | + dbus-run-session -- bash -c ' |
| 102 | + gsettings set org.gnome.desktop.interface toolkit-accessibility true |
| 103 | + /usr/libexec/at-spi-bus-launcher --launch-immediately & |
| 104 | + sleep 2 |
| 105 | + python -m xmlrunner discover \ |
| 106 | + -s tests/interface \ |
| 107 | + -o test-results/ \ |
| 108 | + -v |
| 109 | + ' |
| 110 | +
|
| 111 | + - name: Upload test results |
| 112 | + if: always() |
| 113 | + uses: actions/upload-artifact@v4 |
| 114 | + with: |
| 115 | + name: test-results |
| 116 | + path: | |
| 117 | + gramps-testbed/test-results/ |
| 118 | + artifacts/ |
| 119 | +
|
| 120 | + - name: Publish test report |
| 121 | + if: always() |
| 122 | + uses: dorny/test-reporter@v1 |
| 123 | + with: |
| 124 | + name: Interface Tests |
| 125 | + path: gramps-testbed/test-results/*.xml |
| 126 | + reporter: java-junit |
0 commit comments