-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
207 lines (172 loc) · 6.09 KB
/
integration.yml
File metadata and controls
207 lines (172 loc) · 6.09 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: Integration
on:
push:
branches:
- master
- v3.7
- v3.6
- v3.5
- v3.4
- v3.3
- ios-2024_2
pull_request:
workflow_dispatch:
jobs:
ScreenshotTests:
name: Run Screenshot Tests
runs-on: ubuntu-latest
container:
image: ghcr.io/onemillionworlds/opengl-docker-image:v1
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup the java environment
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Start xvfb
run: |
Xvfb :99 -ac -screen 0 1024x768x16 &
export DISPLAY=:99
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Report GL/Vulkan
run: |
set -x
echo "DISPLAY=$DISPLAY"
glxinfo | grep -E "OpenGL version|OpenGL renderer|OpenGL vendor" || true
vulkaninfo --summary || true
echo "VK_ICD_FILENAMES=$VK_ICD_FILENAMES"
echo "MESA_LOADER_DRIVER_OVERRIDE=$MESA_LOADER_DRIVER_OVERRIDE"
echo "GALLIUM_DRIVER=$GALLIUM_DRIVER"
- name: Validate the Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Test with Gradle Wrapper
run: |
./gradlew --no-daemon :jme3-screenshot-tests:screenshotTest
- name: Upload Test Reports
uses: actions/upload-artifact@v4
if: always()
with:
name: screenshot-test-report
retention-days: 30
path: |
**/build/reports/**
**/build/changed-images/**
**/build/test-results/**
ScreenshotTestsMacOS:
name: Run Screenshot Tests (macOS)
runs-on: macos-15-intel
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup the java environment
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Validate the Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Prepare patched GLFW for macOS software renderer
shell: bash
run: |
set -euo pipefail
if ! command -v cmake >/dev/null 2>&1; then
brew install cmake
fi
curl -L -o glfw-3.4.tar.gz https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz
tar -xzf glfw-3.4.tar.gz
mv glfw-3.4 glfw-src
python3 - <<'PY'
from pathlib import Path
p = Path("glfw-src/src/nsgl_context.m")
text = p.read_text()
old = " ADD_ATTRIB(NSOpenGLPFAAccelerated);"
new = (
" ADD_ATTRIB(NSOpenGLPFARendererID);\n"
" ADD_ATTRIB(kCGLRendererGenericFloatID);"
)
if old not in text:
raise SystemExit("Patch anchor not found in src/nsgl_context.m")
p.write_text(text.replace(old, new, 1))
print("Patched src/nsgl_context.m")
PY
cmake -S glfw-src -B glfw-build \
-D BUILD_SHARED_LIBS=ON \
-D GLFW_BUILD_EXAMPLES=OFF \
-D GLFW_BUILD_TESTS=OFF \
-D GLFW_BUILD_DOCS=OFF \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_OSX_ARCHITECTURES=x86_64
cmake --build glfw-build --config Release --parallel 3
mkdir -p ci-glfw
if [ -f glfw-build/src/libglfw.3.dylib ]; then
cp glfw-build/src/libglfw.3.dylib ci-glfw/libglfw-ci.dylib
elif [ -f glfw-build/src/libglfw.dylib ]; then
cp glfw-build/src/libglfw.dylib ci-glfw/libglfw-ci.dylib
else
echo "Could not find built GLFW dylib"
find glfw-build -name '*.dylib' -print
exit 1
fi
file ci-glfw/libglfw-ci.dylib
otool -L ci-glfw/libglfw-ci.dylib
- name: Test with Gradle Wrapper
env:
JAVA_TOOL_OPTIONS: -Dorg.lwjgl.glfw.libname=${{ github.workspace }}/ci-glfw/libglfw-ci.dylib
run: |
./gradlew --no-daemon :jme3-screenshot-tests:screenshotTest
- name: Upload Test Reports
uses: actions/upload-artifact@v4
if: always()
with:
name: screenshot-test-report-macos
retention-days: 30
path: |
**/build/reports/**
**/build/changed-images/**
**/build/test-results/**
ScreenshotTestsWindows:
name: Run Screenshot Tests (Windows)
runs-on: windows-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup the java environment
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Set up Mesa3D for software OpenGL rendering
shell: pwsh
run: |
$version = "24.2.4"
$url = "https://github.com/pal1000/mesa-dist-win/releases/download/$version/mesa3d-$version-release-msvc.7z"
Invoke-WebRequest -Uri $url -OutFile mesa3d.7z
7z x mesa3d.7z -omesa3d
$javaBin = Join-Path $env:JAVA_HOME "bin"
# Deploy Mesa next to java.exe, because java.exe is the actual process executable.
Copy-Item "mesa3d\x64\*.dll" "$javaBin\" -Force
# Force app-local DLL resolution for java.exe if the process would otherwise bypass it.
New-Item -ItemType File -Force -Path (Join-Path $javaBin "java.exe.local") | Out-Null
# Start with llvmpipe first; it is Mesa's intended software fallback.
"GALLIUM_DRIVER=llvmpipe" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Validate the Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Test with Gradle Wrapper
shell: bash
run: |
./gradlew --no-daemon :jme3-screenshot-tests:screenshotTest
- name: Upload Test Reports
uses: actions/upload-artifact@v4
if: always()
with:
name: screenshot-test-report-windows
retention-days: 30
path: |
**/build/reports/**
**/build/changed-images/**
**/build/test-results/**