Files
dikte/.github/workflows/ui-screenshots.yml
T

67 lines
2.2 KiB
YAML

name: UI screenshots
run-name: "UI screenshots (${{ inputs.pr && format('PR #{0}', inputs.pr) || github.ref_name }})"
on:
workflow_dispatch:
inputs:
pr:
description: "PR number to capture (leave empty for the selected branch)"
required: false
type: string
permissions:
contents: read
jobs:
capture:
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: xcb
- os: macos-latest
platform: cocoa
- os: windows-latest
platform: windows
runs-on: ${{ matrix.os }}
env:
QT_QPA_PLATFORM: ${{ matrix.platform }}
QT_SCALE_FACTOR: "2"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.pr && format('refs/pull/{0}/head', inputs.pr) || github.ref }}
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install Linux display libraries
if: runner.os == 'Linux'
timeout-minutes: 5
run: |
apt="-o Acquire::Retries=3 -o Acquire::http::Timeout=20"
sudo apt-get $apt update
sudo apt-get $apt install --no-install-recommends -y \
xvfb xauth libegl1 libgl1 libxkbcommon0 libdbus-1-3 \
libglib2.0-0 libfontconfig1 libfreetype6 libgssapi-krb5-2 \
libxcb-cursor0 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-keysyms1 libxcb-shape0 libxcb-xinerama0 libxcb-render-util0
- name: Install PyQt6
run: python -m pip install --quiet PyQt6
- name: Capture with X11
if: runner.os == 'Linux'
run: xvfb-run -a -s "-screen 0 2400x1600x24" python -m tests.render_ui --output ui-screenshots --expect-platform xcb
- name: Capture with the native platform
if: runner.os != 'Linux'
run: python -m tests.render_ui --output ui-screenshots --expect-platform ${{ matrix.platform }}
- name: Upload screenshots and rendering details
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ui-screenshots-${{ runner.os }}
path: ui-screenshots/
if-no-files-found: error
retention-days: 90