Skip to content

Commit 1bf73d6

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) When using Xwayland, the GDK_BACKEND can be either x11 or wayland. For the other two cases the two need to match. This commit enables 5 new configuration options to build, with "GTK3 x11 (uses Xvfb)" being the pre-existing one. It is expected a future commit will start limiting how many of these run for all PRs. Part of #2714
1 parent 1d64c02 commit 1bf73d6

File tree

2 files changed

+58
-5
lines changed

2 files changed

+58
-5
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,41 @@ on:
2929
required: false
3030
default: false
3131
gtk:
32-
description: "(Required on Linux only) GTK version to use (one of gtk3, gtk4)"
32+
description: |
33+
(Required on Linux only) GTK version to use (one of gtk3, gtk4)
34+
35+
Controls the SWT_GTK4 environemnt variable.
36+
type: string
37+
required: false
38+
default: ""
39+
gdk_backend:
40+
description: |
41+
(Required on Linux only) GDK_BACKEND to use (one of x11, wayland)
42+
43+
Sets the GDK_BACKEND to x11 or wayland. The compositor has to support
44+
the GDK_BACKEND to be useful. For example, setting GDK_BACKEND to
45+
x11 and compositor to wayland will lead to no available handles
46+
due to no x11 display being available.
47+
type: string
48+
required: false
49+
default: ""
50+
compositor:
51+
description: |
52+
(Required on Linux only) Compositor type to use (one of x11, xwayland, wayland)
53+
54+
x11: Uses a "pure" x11 compositor with no wayland display running, using Xvfb.
55+
This is the most common setup for older linux distros that don't come
56+
with wayland, and for some lightweight distro that only have x11.
57+
xwayland: Runs weston for Wayland display and Xwayland for x11 display
58+
simulatanously. Xwayland provides an x11 display and draws that on
59+
the Wayland compositor.
60+
This is the most common setup for most current linux distros, as of this
61+
writing. Xwayland provides a way for apps that have nor updated to Wayland
62+
to continue to run. There are some signs that Xwayland may be removed
63+
in future distros.
64+
wayland: Uses a "pure" wayland compositor with no x11 display running, using
65+
weston.
66+
This is likely to be the future default setup of most distros.
3367
type: string
3468
required: false
3569
default: ""
@@ -55,6 +89,8 @@ jobs:
5589
sudo apt-get install -qq -y libgtk-3-dev freeglut3-dev webkit2gtk-driver
5690
# GTK4 dependencies
5791
sudo apt-get install -qq -y libgtk-4-dev freeglut3-dev libwebkitgtk-6.0-4
92+
# Wayland runtimes, xwayland-run depends on all the needed packages
93+
sudo apt-get install -qq -y xwayland-run
5894
5995
- name: Disable AppArmor when testing WebKit on GTK4
6096
if: ${{ inputs.native == 'gtk.linux.x86_64' && inputs.gtk == 'gtk4' }}
@@ -84,8 +120,11 @@ jobs:
84120
env:
85121
GTK_XCFLAGS: '-Wno-deprecated-declarations'
86122
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
123+
GDK_BACKEND: "${{ inputs.gdk_backend }}"
87124
run: >-
88-
${{ contains(inputs.native, 'linux') && 'xvfb-run' || '' }}
125+
${{ inputs.compositor == 'x11' && 'xvfb-run' || '' }}
126+
${{ inputs.compositor == 'wayland' && 'wlheadless-run --width 1920 --height 1080 -- ' || '' }}
127+
${{ inputs.compositor == 'xwayland' && 'wlheadless-run --width 1920 --height 1080 -- xwayland-run -geometry 1920x1080 -- ' || '' }}
89128
mvn --batch-mode -V -U -e
90129
--threads 1C
91130
-DforkCount=1
@@ -95,15 +134,20 @@ jobs:
95134
--fail-at-end
96135
-DskipNativeTests=false
97136
-DfailIfNoTests=false
98-
${{ (inputs.runtodotests == false && inputs.gtk == 'gtk4') && '-DexcludedGroups=gtk4-todo' || '' }}
137+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk4' && inputs.gdk_backend == 'wayland') && '-DexcludedGroups=gtk4-todo,gtk4-wayland-todo' || '' }}
138+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk4' && inputs.gdk_backend == 'x11') && '-DexcludedGroups=gtk4-todo' || '' }}
139+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk3' && inputs.gdk_backend == 'wayland') && '-DexcludedGroups=gtk3-wayland-todo' || '' }}
99140
clean install
100141
- name: Performance tests
101142
if: ${{ inputs.performance }}
102143
env:
103144
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
145+
GDK_BACKEND: "${{ inputs.gdk_backend }}"
104146
working-directory: tests/org.eclipse.swt.tests
105147
run: >-
106-
${{ contains(inputs.native, 'linux') && 'xvfb-run' || '' }}
148+
${{ inputs.compositor == 'x11' && 'xvfb-run' || '' }}
149+
${{ inputs.compositor == 'wayland' && 'wlheadless-run --width 1920 --height 1080 -- ' || '' }}
150+
${{ inputs.compositor == 'xwayland' && 'wlheadless-run --width 1920 --height 1080 -- xwayland-run -geometry 1920x1080 -- ' || '' }}
107151
mvn --batch-mode -V -U -e
108152
-DforkCount=1
109153
--fail-at-end
@@ -115,7 +159,7 @@ jobs:
115159
if: always()
116160
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
117161
with:
118-
name: test-results-${{ inputs.native }}-${{ inputs.gtk }}-java${{ inputs.java }}
162+
name: test-results-${{ inputs.native }}-${{ inputs.gtk }}-${{ inputs.gdk_backend }}-${{ inputs.compositor }}-java${{ inputs.java }}
119163
if-no-files-found: warn
120164
path: |
121165
${{ github.workspace }}/**/target/surefire-reports/*.xml

.github/workflows/maven.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,21 @@ jobs:
3838
matrix:
3939
java: ['21']
4040
gtk: [gtk3, gtk4]
41+
gdk_backend: [x11, wayland]
42+
compositor: [x11, xwayland, wayland]
43+
exclude:
44+
- gdk_backend: x11
45+
compositor: wayland
46+
- gdk_backend: wayland
47+
compositor: x11
4148
uses: ./.github/workflows/build.yml
4249
with:
4350
runner: ubuntu-latest
4451
java: ${{ matrix.java }}
4552
native: gtk.linux.x86_64
4653
gtk: ${{ matrix.gtk }}
54+
gdk_backend: ${{ matrix.gdk_backend }}
55+
compositor: ${{ matrix.compositor }}
4756
performance: ${{ contains(github.event.pull_request.labels.*.name, 'performance') }}
4857
runtodotests: ${{ contains(github.event.pull_request.labels.*.name, 'runtodotests') }}
4958

0 commit comments

Comments
 (0)