Skip to content

Commit 45ee541

Browse files
committed
Add Wayland to build matrix on GitHub actions
Add a compositor type build matrix entry for wayland, xwayland and x11. There are a total of 6 combinations possible of GTK/compositor: - GTK3 x11 (uses Xvfb) - GTK3 Xwayland (uses xwayland under weston headless) - GTK3 wayland (uses weston headless) - GTK4 x11 (uses Xvfb) - GTK4 Xwayland (uses xwayland under weston headless) - GTK4 wayland (uses weston headless) The most common use case is the current users who are GTK3 on x11, possibly with xwayland under wayland compositor (e.g. KWin, mutter), or using X directly with Xorg and xfwm4 or some other one. Traditionally we have tested this use case with Xvfb which provides similar result. For GTK4 the primary focus is Wayland with no X server involved. Therefore, of the 6 possible combinations I have enabled only: - GTK3 x11 (uses Xvfb) - GTK4 wayland (uses weston headless) Part of #2714
1 parent ba8986a commit 45ee541

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ on:
3333
type: string
3434
required: false
3535
default: ""
36+
compositor:
37+
description: "(Required on Linux only) Compositor type to use (one of x11, xwayland, wayland)"
38+
type: string
39+
required: false
40+
default: ""
3641

3742
jobs:
3843
build:
@@ -55,6 +60,8 @@ jobs:
5560
sudo apt-get install -qq -y libgtk-3-dev freeglut3-dev webkit2gtk-driver
5661
# GTK4 dependencies
5762
sudo apt-get install -qq -y libgtk-4-dev freeglut3-dev libwebkitgtk-6.0-4
63+
# Wayland runtimes
64+
sudo apt-get install -qq -y xwayland-run
5865
5966
- name: Disable AppArmor when testing WebKit on GTK4
6067
if: ${{ inputs.native == 'gtk.linux.x86_64' && inputs.gtk == 'gtk4' }}
@@ -84,8 +91,11 @@ jobs:
8491
env:
8592
GTK_XCFLAGS: '-Wno-deprecated-declarations'
8693
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
94+
GDK_BACKEND: "${{ inputs.compositor == 'wayland' && 'wayland' || 'x11' }}"
8795
run: >-
88-
${{ contains(inputs.native, 'linux') && 'xvfb-run' || '' }}
96+
${{ inputs.compositor == 'x11' && 'xvfb-run' || '' }}
97+
${{ inputs.compositor == 'wayland' && 'wlheadless-run --width 1920 --height 1080 -- ' || '' }}
98+
${{ inputs.compositor == 'xwayland' && 'wlheadless-run --width 1920 --height 1080 -- xwayland-run -geometry 1920x1080 -- ' || '' }}
8999
mvn --batch-mode -V -U -e
90100
--threads 1C
91101
-DforkCount=1
@@ -95,15 +105,20 @@ jobs:
95105
--fail-at-end
96106
-DskipNativeTests=false
97107
-DfailIfNoTests=false
98-
${{ (inputs.runtodotests == false && inputs.gtk == 'gtk4') && '-DexcludedGroups=gtk4-todo' || '' }}
108+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk4' && inputs.compositor == 'wayland') && '-DexcludedGroups=gtk4-todo,gtk4-wayland-todo' || '' }}
109+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk3' && inputs.compositor == 'wayland') && '-DexcludedGroups=gtk3-wayland-todo' || '' }}
110+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk4' && inputs.compositor != 'wayland') && '-DexcludedGroups=gtk4-todo' || '' }}
99111
clean install
100112
- name: Performance tests
101113
if: ${{ inputs.performance }}
102114
env:
103115
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
116+
GDK_BACKEND: "${{ inputs.compositor == 'wayland' && 'wayland' || 'x11' }}"
104117
working-directory: tests/org.eclipse.swt.tests
105118
run: >-
106-
${{ contains(inputs.native, 'linux') && 'xvfb-run' || '' }}
119+
${{ inputs.compositor == 'x11' && 'xvfb-run' || '' }}
120+
${{ inputs.compositor == 'wayland' && 'wlheadless-run --width 1920 --height 1080 -- ' || '' }}
121+
${{ inputs.compositor == 'xwayland' && 'wlheadless-run --width 1920 --height 1080 -- xwayland-run -geometry 1920x1080 -- ' || '' }}
107122
mvn --batch-mode -V -U -e
108123
-DforkCount=1
109124
--fail-at-end
@@ -115,7 +130,7 @@ jobs:
115130
if: always()
116131
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
117132
with:
118-
name: test-results-${{ inputs.native }}-${{ inputs.gtk }}-java${{ inputs.java }}
133+
name: test-results-${{ inputs.native }}-${{ inputs.gtk }}-${{ inputs.compositor }}-java${{ inputs.java }}
119134
if-no-files-found: warn
120135
path: |
121136
${{ github.workspace }}/**/target/surefire-reports/*.xml

.github/workflows/maven.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,21 @@ jobs:
8686
matrix:
8787
java: ['21']
8888
gtk: [gtk3, gtk4]
89+
compositor: [x11, xwayland, wayland]
90+
exclude:
91+
# run gtk3 on x11 only and gtk4 on wayland only
92+
- gtk: gtk3
93+
compositor: wayland
94+
- gtk: gtk4
95+
compositor: x11
96+
- compositor: xwayland # xwayland doesn't seem to add much over x11 on xvfb
8997
uses: ./.github/workflows/build.yml
9098
with:
9199
runner: ubuntu-latest
92100
java: ${{ matrix.java }}
93101
native: gtk.linux.x86_64
94102
gtk: ${{ matrix.gtk }}
103+
compositor: ${{ matrix.compositor }}
95104
performance: ${{ contains(github.event.pull_request.labels.*.name, 'performance') }}
96105
runtodotests: ${{ contains(github.event.pull_request.labels.*.name, 'runtodotests') }}
97106

0 commit comments

Comments
 (0)