Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
type: boolean
required: false
default: false
gtk:
description: "(Required on Linux only) GTK version to use (one of gtk3, gtk4)"
type: string
required: false
default: ""

jobs:
build:
Expand All @@ -40,9 +45,27 @@ jobs:
lfs: false # lfs-pull is not necessary, the natives are re-build in each run
- name: Install Linux requirements
if: ${{ inputs.native == 'gtk.linux.x86_64'}}
shell: bash
run: |
set -x
sudo apt-get update -qq
sudo apt-get install -qq -y libgtk-3-dev libgtk-4-dev freeglut3-dev webkit2gtk-driver
# Required tools (GHA normally provides these in their base images)
sudo apt-get install -qq -y build-essential git
# GTK3 dependencies
sudo apt-get install -qq -y libgtk-3-dev freeglut3-dev webkit2gtk-driver
# GTK4 dependencies
sudo apt-get install -qq -y libgtk-4-dev freeglut3-dev libwebkitgtk-6.0-4

- name: Disable AppArmor when testing WebKit on GTK4
if: ${{ inputs.native == 'gtk.linux.x86_64' && inputs.gtk == 'gtk4' }}
shell: bash
run: |
# WebKit for GTK4 uses bwrap and on Ubuntu 24.04 default settings are not working
# so turn off apparmor. We are already running in a protected environment, so we
# don't really need this extra level.
sudo sysctl kernel.unprivileged_userns_clone=1
sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0

- name: Pull large static Windows binaries
if: ${{ inputs.native == 'win32.win32.x86_64'}}
run: |
Expand All @@ -60,6 +83,7 @@ jobs:
- name: Build
env:
GTK_XCFLAGS: '-Wno-deprecated-declarations'
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
run: >-
${{ contains(inputs.native, 'linux') && 'xvfb-run' || '' }}
mvn --batch-mode -V -U -e
Expand All @@ -71,10 +95,12 @@ jobs:
--fail-at-end
-DskipNativeTests=false
-DfailIfNoTests=false
${{ (inputs.runtodotests == false && contains(inputs.native, 'linux')) && '-DexcludedGroups=gtk3-todo' || '' }}
${{ (inputs.runtodotests == false && inputs.gtk == 'gtk4') && '-DexcludedGroups=gtk4-todo' || '' }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no tests currently tagged with gtk3-todos which is a good thing as GTK3 on x11 should be well covered.

There are some gtk3-wayland-todo tags, which are excluded in the next PR #2768

clean install
- name: Performance tests
if: ${{ inputs.performance }}
env:
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
working-directory: tests/org.eclipse.swt.tests
run: >-
${{ contains(inputs.native, 'linux') && 'xvfb-run' || '' }}
Expand All @@ -89,7 +115,7 @@ jobs:
if: always()
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: test-results-${{ inputs.native }}-java${{ inputs.java }}
name: test-results-${{ inputs.native }}-${{ inputs.gtk }}-java${{ inputs.java }}
if-no-files-found: warn
path: |
${{ github.workspace }}/**/target/surefire-reports/*.xml
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This is the main maven workflow for SWT.

# You can run this locally to test changes with the act command https://nektosact.com/
# For example, to run all linux tests on Java 21:
# act -j build-linux --matrix java:21 --artifact-server-path $PWD/.artifacts
# For example, to run all GTK4 tests:
# act -j build-linux --matrix java:21 --matrix gtk:gtk4 --artifact-server-path $PWD/.artifacts
# You may need to download runners on first run, act will ask but if you
# want the big runner there is no progress as it downloads, so you can pull it with
# docker directly:
Expand All @@ -20,9 +20,6 @@ on:
branches: [ master ]
types: [opened, reopened, synchronize, labeled]

env:
SWT_GTK4: "${{ contains(github.event.pull_request.labels.*.name, 'gtk4') && '1' || '0' }}"

jobs:
event_file:
name: "Event File"
Expand All @@ -40,11 +37,13 @@ jobs:
fail-fast: false
matrix:
java: ['21']
gtk: [gtk3, gtk4]
uses: ./.github/workflows/build.yml
with:
runner: ubuntu-latest
java: ${{ matrix.java }}
native: gtk.linux.x86_64
gtk: ${{ matrix.gtk }}
performance: ${{ contains(github.event.pull_request.labels.*.name, 'performance') }}
runtodotests: ${{ contains(github.event.pull_request.labels.*.name, 'runtodotests') }}

Expand Down
Loading