-
Notifications
You must be signed in to change notification settings - Fork 194
146 lines (138 loc) · 6.07 KB
/
build.yml
File metadata and controls
146 lines (138 loc) · 6.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: "SWT Build"
on:
workflow_call:
inputs:
runner:
description: "build.runs-on value"
type: string
required: true
java:
description: "Java version"
type: string
required: true
native:
description: "Native target identifier (one of gtk.linux.x86_64, win32.win32.x86_64, cocoa.macosx.x86_64, cocoa.macosx.aarch64)"
type: string
required: true
performance:
description: "Run performance tests too (one of true, false)"
type: boolean
required: false
default: false
runtodotests:
description: "Run TODO tagged tests too (one of true, false)"
type: boolean
required: false
default: false
gtk:
description: |
(Required on Linux only) GTK version to use (one of gtk3, gtk4)
Controls the SWT_GTK4 environemnt variable.
type: string
required: false
default: ""
gdk_backend:
description: |
(Required on Linux only) GDK_BACKEND to use (one of x11, wayland)
The backend will affect which compositor to use.
type: string
required: false
default: ""
jobs:
build:
runs-on: ${{ inputs.runner }}
steps:
- name: checkout swt
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
with:
fetch-depth: 0 # required for jgit timestamp provider to work
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
# 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
# x11 + wayland runtimes
sudo apt-get install -qq -y dbus-daemon xvfb mutter
- 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: |
git lfs pull --include='/binaries/org.eclipse.swt.win32.win32.x86_64/WebView2Loader.dll'
- name: Set up Java ${{ inputs.java }}
uses: actions/setup-java@de5a937a1dc73fbc1a67d7d1aa4bebc1082f3190 # v5.0.0
with:
java-version: ${{ inputs.java }}
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.14
- name: Build
env:
GTK_XCFLAGS: '-Wno-deprecated-declarations'
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
GDK_BACKEND: "${{ inputs.gdk_backend }}"
# Run wayland/x11 sessions in a similar way that GTK tests itself
# https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-4-20/.gitlab-ci/run-tests.sh
run: >-
${{ inputs.gdk_backend == 'x11' && 'dbus-run-session -- xvfb-run -a -s "-screen 0 1024x768x24 -noreset"' || '' }}
${{ 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 -- ' || '' }}
mvn --batch-mode -V -U -e
--threads 1C
-DforkCount=1
'-Dnative=${{ inputs.native }}'
-Papi-check -Pjavadoc
'-Dtycho.baseline.replace=none'
--fail-at-end
-DskipNativeTests=false
-DfailIfNoTests=false
${{ (inputs.runtodotests == false && inputs.gtk =='gtk4' && inputs.gdk_backend == 'wayland') && '-DexcludedGroups=gtk4-todo,gtk4-wayland-todo' || '' }}
${{ (inputs.runtodotests == false && inputs.gtk =='gtk4' && inputs.gdk_backend == 'x11') && '-DexcludedGroups=gtk4-todo' || '' }}
${{ (inputs.runtodotests == false && inputs.gtk =='gtk3' && inputs.gdk_backend == 'wayland') && '-DexcludedGroups=gtk3-wayland-todo' || '' }}
clean install
- name: Performance tests
if: ${{ inputs.performance }}
env:
SWT_GTK4: "${{ inputs.gtk == 'gtk4' && '1' || '0' }}"
GDK_BACKEND: "${{ inputs.gdk_backend }}"
working-directory: tests/org.eclipse.swt.tests
run: >-
${{ inputs.gdk_backend == 'x11' && 'dbus-run-session -- xvfb-run -a -s "-screen 0 1024x768x24 -noreset"' || '' }}
${{ 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 -- ' || '' }}
mvn --batch-mode -V -U -e
-DforkCount=1
--fail-at-end
-DskipNativeTests=true
-DfailIfNoTests=true
-Dtest=PerformanceTests
integration-test
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results-${{ inputs.native }}-${{ inputs.gtk }}-${{ inputs.gdk_backend }}-java${{ inputs.java }}
if-no-files-found: warn
path: |
${{ github.workspace }}/**/target/surefire-reports/*.xml
${{ github.workspace }}/**/*.log
${{ github.workspace }}/**/*.dump
${{ github.workspace }}/**/*.dumpstream