Skip to content
Draft
6 changes: 6 additions & 0 deletions .github/workflows/periodic_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,9 @@ jobs:
env:
STEPS_CPR_OUTPUTS_PULL_REQUEST_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
STEPS_CPR_OUTPUTS_PULL_REQUEST_URL: ${{ steps.cpr.outputs.pull-request-url }}
wxgui-screenshots:
# The update-i18n job builds without the GUI, so the screenshots are
# captured in a separate workflow (also run for changes to it).
permissions:
contents: read
uses: $/.github/workflows/wxgui_screenshots.yml
59 changes: 59 additions & 0 deletions .github/workflows/wxgui_screenshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: wxGUI screenshots

# Captures wxGUI screenshots with the translatable strings they show, for
# example to give translators visual context on Weblate. The result is only
# uploaded as an artifact; see utils/weblate_screenshots/weblate_upload.py for
# synchronizing it to Weblate.
on:
workflow_call:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/wxgui_screenshots.yml"
- "utils/weblate_screenshots/**"

permissions: {}

jobs:
capture:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build gettext python3-wxgtk4.0 \
xvfb imagemagick librsvg2-common
LC_ALL=C.UTF-8 sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update -y
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
sudo apt-get install -y --no-install-recommends --no-install-suggests
- name: Configure
run: |
cmake -S "${GITHUB_WORKSPACE}" -B "${GITHUB_WORKSPACE}/build" -G Ninja -DWITH_DOCS=OFF
- name: Build
run: cmake --build build -j"$(nproc)"
- name: Capture screenshots
env:
GRASS_CONFIG_DIR: ${{ runner.temp }}/grass-config
LANG: C.UTF-8
run: |
export PATH="${GITHUB_WORKSPACE}/build/output/bin:${PATH}"
mkdir -p "${GRASS_CONFIG_DIR}"
# A fixed project path keeps the screenshots identical between runs.
grass -e -c XY /tmp/grassdata/screenshots
xvfb-run -s "-screen 0 1600x1200x24" \
grass /tmp/grassdata/screenshots/PERMANENT --exec \
python3 utils/weblate_screenshots/wxgui_capture.py \
--pot locale/templates/grasswxpy.pot --output wxgui-screenshots
- name: Upload screenshots
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wxgui-screenshots
path: wxgui-screenshots
retention-days: 30
Loading
Loading