Skip to content

Commit 9b2791a

Browse files
authored
Split workflows and add regressions (#201)
* add run windows runs test * one ci file
1 parent 7975540 commit 9b2791a

File tree

2 files changed

+99
-152
lines changed

2 files changed

+99
-152
lines changed

.github/workflows/release.yml

+99-70
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Hop release
1+
name: Hop CI
22

33
on:
44
push:
@@ -81,18 +81,18 @@ jobs:
8181
name: headers-mingw
8282
path: headers-mingw
8383

84-
linuxNative:
84+
linux:
8585
runs-on: ubuntu-20.04
8686

8787
steps:
8888
- uses: actions/checkout@v4
8989
with:
9090
submodules: 'recursive'
9191

92-
- name: Install dependencies
92+
- name: install dependencies
9393
run: sudo apt-get update && sudo apt-get install -y build-essential xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
9494

95-
- name: linux-linux
95+
- name: build
9696
run: |
9797
git submodule update --recursive
9898
./build.sh -t -d -r
@@ -105,7 +105,7 @@ jobs:
105105
cp -r build/PerlinWorld demos/
106106
cd demos && zip -r ../demos.zip * && cd ..
107107
108-
- name: Tests
108+
- name: unit tests
109109
working-directory: ${{github.workspace}}/build
110110
# Execute tests defined by the CMake configuration.
111111
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
@@ -127,18 +127,54 @@ jobs:
127127
name: demoLinux
128128
path: demos.zip
129129

130-
linuxXwindows:
130+
linuxBuildAndRun:
131131
runs-on: ubuntu-22.04
132132

133+
strategy:
134+
matrix:
135+
example: [PerlinWorld, SoftBodyTetris, Sprites, MeshEditor]
136+
133137
steps:
134138
- uses: actions/checkout@v4
135139
with:
136140
submodules: 'recursive'
137141

138-
- name: Install dependencies
142+
- name: install dependencies
143+
run: sudo apt-get update && sudo apt-get install -y build-essential xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev xvfb x11-apps vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
144+
145+
- name: build
146+
run: |
147+
./build.sh -t -r -d
148+
- name: run ${{ matrix.example }}
149+
run: |
150+
cd build/${{ matrix.example }}
151+
chmod +x ${{ matrix.example }}
152+
export DISPLAY=:99
153+
sudo Xvfb :99 -screen 0 800x600x24 &
154+
sleep 5
155+
MESA_GL_VERSION_OVERRIDE=3.3 ./${{ matrix.example }} &
156+
export PID=$!
157+
sleep 10
158+
xwd -root -silent | convert xwd:- png:screenshot.png
159+
sleep 5 && kill $PID
160+
- name: upload screenshot
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: ${{ matrix.example }}.png
164+
path: build/${{ matrix.example }}/screenshot.png
165+
166+
windows:
167+
runs-on: ubuntu-22.04
168+
169+
steps:
170+
- uses: actions/checkout@v4
171+
with:
172+
submodules: 'recursive'
173+
174+
- name: install dependencies
139175
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools wine64
140176

141-
- name: linux-X-windows
177+
- name: build
142178
run: |
143179
git submodule update --recursive
144180
./build.sh -w -d -r -t
@@ -154,7 +190,7 @@ jobs:
154190
cd demos && zip -r ../demos.zip * && cd ..
155191
cp build/*.dll build/TestScriptPack/
156192
157-
- name: Tests (wine64)
193+
- name: unit tests
158194
working-directory: ${{github.workspace}}/build
159195
# Execute tests defined by the CMake configuration.
160196
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
@@ -177,15 +213,52 @@ jobs:
177213
name: demoWindows
178214
path: demos.zip
179215

180-
macosNative:
216+
windowsBuildAndRun:
217+
runs-on: ubuntu-22.04
218+
219+
strategy:
220+
matrix:
221+
example: [PerlinWorld, SoftBodyTetris, Sprites, MeshEditor]
222+
223+
steps:
224+
- uses: actions/checkout@v4
225+
with:
226+
submodules: 'recursive'
227+
228+
- name: install dependencies
229+
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev xvfb x11-apps vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools wine64
230+
231+
- name: build
232+
run: |
233+
./build.sh -r -w -d
234+
- name: run ${{ matrix.example }}
235+
run: |
236+
cd build/${{ matrix.example }}
237+
cp ../*.dll .
238+
chmod +x ${{ matrix.example }}.exe
239+
export DISPLAY=:99
240+
sudo Xvfb :99 -screen 0 800x600x24 &
241+
sleep 5
242+
MESA_GL_VERSION_OVERRIDE=3.3 wine64 ${{ matrix.example }}.exe &
243+
export PID=$!
244+
sleep 10
245+
xwd -root -silent | convert xwd:- png:screenshot.png
246+
sleep 5 && kill $PID
247+
- name: upload screenshots
248+
uses: actions/upload-artifact@v4
249+
with:
250+
name: ${{ matrix.example }}-wine.png
251+
path: build/${{ matrix.example }}/screenshot.png
252+
253+
macos:
181254
runs-on: macos-13
182255

183256
steps:
184257
- uses: actions/checkout@v4
185258
with:
186259
submodules: 'recursive'
187260

188-
- name: Install dependencies
261+
- name: install dependencies
189262
run: |
190263
wget https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.zip -O vulkan-sdk.zip
191264
unzip vulkan-sdk.zip
@@ -194,7 +267,7 @@ jobs:
194267
cd ~/vulkan/
195268
python install_vulkan.py
196269
197-
- name: macos build
270+
- name: build
198271
run: |
199272
git submodule update --recursive
200273
./build.sh -o -d -r -t
@@ -207,7 +280,7 @@ jobs:
207280
cp -r build/PerlinWorld demos/
208281
cd demos && zip -r ../demos.zip * && cd ..
209282
210-
- name: Tests
283+
- name: unit tests
211284
working-directory: ${{github.workspace}}/build
212285
# Execute tests defined by the CMake configuration.
213286
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
@@ -225,51 +298,7 @@ jobs:
225298
name: demomacos
226299
path: demos.zip
227300

228-
linuxRun:
229-
needs: linuxNative
230-
runs-on: ubuntu-20.04
231-
232-
steps:
233-
- name: Install dependencies
234-
run: sudo apt-get update && sudo apt-get install -y xvfb x11-apps imagemagick
235-
236-
- name: get linux demos
237-
uses: actions/download-artifact@v4
238-
with:
239-
name: demoLinux
240-
241-
- name: launch and screenshot
242-
run: |
243-
unzip demos.zip
244-
cd PerlinWorld
245-
chmod +x PerlinWorld
246-
export DISPLAY=:99
247-
sudo Xvfb :99 -screen 0 800x600x24 &
248-
sleep 5
249-
MESA_GL_VERSION_OVERRIDE=3.3 ./PerlinWorld &
250-
export PID=$!
251-
sleep 10
252-
xwd -root -silent | convert xwd:- png:screenshot.png
253-
sleep 5 && kill $PID
254-
MESA_GL_VERSION_OVERRIDE=3.3 ./PerlinWorld map &
255-
export PID=$!
256-
sleep 10
257-
xwd -root -silent | convert xwd:- png:screenshot-map.png
258-
sleep 5 && kill $PID
259-
260-
- name: upload artifact
261-
uses: actions/upload-artifact@v4
262-
with:
263-
name: screenshot
264-
path: PerlinWorld/screenshot.png
265-
266-
- name: upload artifact
267-
uses: actions/upload-artifact@v4
268-
with:
269-
name: screenshot-map
270-
path: PerlinWorld/screenshot-map.png
271-
272-
linuxXandroid:
301+
android:
273302
needs: [headers]
274303
runs-on: ubuntu-20.04
275304

@@ -278,7 +307,7 @@ jobs:
278307
with:
279308
submodules: 'recursive'
280309

281-
- name: Install dependencies
310+
- name: install dependencies
282311
run: |
283312
sudo apt-get update && sudo apt-get install -y build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
284313
wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
@@ -295,7 +324,7 @@ jobs:
295324
./cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-34"
296325
echo no | ./cmdline-tools/latest/bin/avdmanager create avd --name android34 --package "system-images;android-34;google_apis;x86_64"
297326
298-
- name: build hop
327+
- name: build
299328
run: |
300329
git submodule update --recursive
301330
./build.sh -r --android android-ndk-r25c
@@ -352,7 +381,7 @@ jobs:
352381
# path: screenshot-android.png
353382

354383
test-release:
355-
needs: [linuxNative, headers]
384+
needs: [linux, headers]
356385
runs-on: ubuntu-22.04
357386

358387
steps:
@@ -371,10 +400,10 @@ jobs:
371400
with:
372401
name: linuxbuild
373402

374-
- name: Install dependencies
403+
- name: install dependencies
375404
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools xvfb x11-apps imagemagick
376405

377-
- name: linux lib test
406+
- name: regression
378407
run: |
379408
ls
380409
mv libHop-linux-x86_64.a libHop.a
@@ -388,7 +417,7 @@ jobs:
388417
cmake .. && make
389418
390419
test-release-mingw:
391-
needs: [linuxXwindows, headers]
420+
needs: [windows, headers]
392421
runs-on: ubuntu-22.04
393422

394423
steps:
@@ -407,10 +436,10 @@ jobs:
407436
with:
408437
name: windowsbuild
409438

410-
- name: Install dependencies
439+
- name: install dependencies
411440
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libz-mingw-w64-dev libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools xvfb x11-apps imagemagick
412441

413-
- name: mingw lib test
442+
- name: regression
414443
run: |
415444
ls
416445
mv libHop-windows.a libHop.a
@@ -422,7 +451,7 @@ jobs:
422451
./build.sh
423452
424453
test-release-macos:
425-
needs: [macosNative, headers]
454+
needs: [macos, headers]
426455
runs-on: macos-13
427456

428457
steps:
@@ -441,7 +470,7 @@ jobs:
441470
with:
442471
name: macosbuild
443472

444-
- name: Install dependencies
473+
- name: install dependencies
445474
run: |
446475
wget https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.zip -O vulkan-sdk.zip
447476
unzip vulkan-sdk.zip
@@ -450,7 +479,7 @@ jobs:
450479
cd ~/vulkan/
451480
python install_vulkan.py
452481
453-
- name: macos lib test
482+
- name: regression
454483
run: |
455484
ls
456485
mv libHop-macos.a libHop.a
@@ -463,7 +492,7 @@ jobs:
463492
cmake .. -DCMAKE_TOOLCHAIN_FILE=../osx.cmake && make
464493
465494
release:
466-
needs: [linuxNative, linuxXwindows, linuxXandroid, macosNative, headers]
495+
needs: [linux, windows, android, macos, headers]
467496
if: github.ref_type == 'tag'
468497
runs-on: ubuntu-20.04
469498

0 commit comments

Comments
 (0)