Skip to content

Commit d94f896

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 075a512 commit d94f896

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ 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+
The backend will affect which compositor to use.
3344
type: string
3445
required: false
3546
default: ""
@@ -55,6 +66,8 @@ jobs:
5566
sudo apt-get install -qq -y libgtk-3-dev freeglut3-dev webkit2gtk-driver
5667
# GTK4 dependencies
5768
sudo apt-get install -qq -y libgtk-4-dev freeglut3-dev libwebkitgtk-6.0-4
69+
# x11 + wayland runtimes
70+
sudo apt-get install -qq -y dbus-daemon xvfb mutter
5871
5972
- name: Disable AppArmor when testing WebKit on GTK4
6073
if: ${{ inputs.native == 'gtk.linux.x86_64' && inputs.gtk == 'gtk4' }}
@@ -84,8 +97,13 @@ jobs:
8497
env:
8598
GTK_XCFLAGS: '-Wno-deprecated-declarations'
8699
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
100+
GDK_BACKEND: "${{ inputs.gdk_backend }}"
101+
102+
# Run wayland/x11 sessions in a similar way that GTK tests itself
103+
# https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-4-20/.gitlab-ci/run-tests.sh
87104
run: >-
88-
${{ contains(inputs.native, 'linux') && 'xvfb-run' || '' }}
105+
${{ inputs.gdk_backend == 'x11' && 'dbus-run-session -- xvfb-run -a -s "-screen 0 1024x768x24 -noreset"' || '' }}
106+
${{ inputs.gdk_backend == 'wayland' && 'XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)" dbus-run-session -- mutter --headless --wayland --no-x11 --virtual-monitor 1024x768 -- ' || '' }}
89107
mvn --batch-mode -V -U -e
90108
--threads 1C
91109
-DforkCount=1
@@ -95,15 +113,19 @@ jobs:
95113
--fail-at-end
96114
-DskipNativeTests=false
97115
-DfailIfNoTests=false
98-
${{ (inputs.runtodotests == false && inputs.gtk == 'gtk4') && '-DexcludedGroups=gtk4-todo' || '' }}
116+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk4' && inputs.gdk_backend == 'wayland') && '-DexcludedGroups=gtk4-todo,gtk4-wayland-todo' || '' }}
117+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk4' && inputs.gdk_backend == 'x11') && '-DexcludedGroups=gtk4-todo' || '' }}
118+
${{ (inputs.runtodotests == false && inputs.gtk =='gtk3' && inputs.gdk_backend == 'wayland') && '-DexcludedGroups=gtk3-wayland-todo' || '' }}
99119
clean install
100120
- name: Performance tests
101121
if: ${{ inputs.performance }}
102122
env:
103123
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
124+
GDK_BACKEND: "${{ inputs.gdk_backend }}"
104125
working-directory: tests/org.eclipse.swt.tests
105126
run: >-
106-
${{ contains(inputs.native, 'linux') && 'xvfb-run' || '' }}
127+
${{ inputs.gdk_backend == 'x11' && 'xwfb-run -s \\-geometry -s 1920x1080 -- ' || '' }}
128+
${{ inputs.gdk_backend == 'wayland' && 'xwfb-run -s \\-geometry -s 1920x1080 -- wlheadless-run -c weston --backend=x11 --width 1920 --height 1080 -- env -u DISPLAY ' || '' }}
107129
mvn --batch-mode -V -U -e
108130
-DforkCount=1
109131
--fail-at-end
@@ -115,7 +137,7 @@ jobs:
115137
if: always()
116138
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
117139
with:
118-
name: test-results-${{ inputs.native }}-${{ inputs.gtk }}-java${{ inputs.java }}
140+
name: test-results-${{ inputs.native }}-${{ inputs.gtk }}-${{ inputs.gdk_backend }}-${{ inputs.compositor }}-java${{ inputs.java }}
119141
if-no-files-found: warn
120142
path: |
121143
${{ github.workspace }}/**/target/surefire-reports/*.xml

.github/workflows/maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ jobs:
3838
matrix:
3939
java: ['21']
4040
gtk: [gtk3, gtk4]
41+
gdk_backend: [x11, wayland]
4142
uses: ./.github/workflows/build.yml
4243
with:
4344
runner: ubuntu-latest
4445
java: ${{ matrix.java }}
4546
native: gtk.linux.x86_64
4647
gtk: ${{ matrix.gtk }}
48+
gdk_backend: ${{ matrix.gdk_backend }}
4749
performance: ${{ contains(github.event.pull_request.labels.*.name, 'performance') }}
4850
runtodotests: ${{ contains(github.event.pull_request.labels.*.name, 'runtodotests') }}
4951

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ target/
66
.polyglot.*
77
pom.tycho
88
.DS_Store
9-
9+
/xdg-runtime-*
1010
/binaries/org.eclipse.swt.*/src/
1111
tmpdir/
1212
‎build_gtk.sh

0 commit comments

Comments
 (0)