Skip to content

Commit

Permalink
Split workflows and add regressions (#201)
Browse files Browse the repository at this point in the history
* add run windows runs test
* one ci file
  • Loading branch information
Jerboa-app authored Nov 24, 2024
1 parent 7975540 commit 9b2791a
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 152 deletions.
169 changes: 99 additions & 70 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Hop release
name: Hop CI

on:
push:
Expand Down Expand Up @@ -81,18 +81,18 @@ jobs:
name: headers-mingw
path: headers-mingw

linuxNative:
linux:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
- name: install dependencies
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

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

linuxXwindows:
linuxBuildAndRun:
runs-on: ubuntu-22.04

strategy:
matrix:
example: [PerlinWorld, SoftBodyTetris, Sprites, MeshEditor]

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
- name: install dependencies
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

- name: build
run: |
./build.sh -t -r -d
- name: run ${{ matrix.example }}
run: |
cd build/${{ matrix.example }}
chmod +x ${{ matrix.example }}
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./${{ matrix.example }} &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID
- name: upload screenshot
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.example }}.png
path: build/${{ matrix.example }}/screenshot.png

windows:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: install dependencies
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

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

macosNative:
windowsBuildAndRun:
runs-on: ubuntu-22.04

strategy:
matrix:
example: [PerlinWorld, SoftBodyTetris, Sprites, MeshEditor]

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: install dependencies
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

- name: build
run: |
./build.sh -r -w -d
- name: run ${{ matrix.example }}
run: |
cd build/${{ matrix.example }}
cp ../*.dll .
chmod +x ${{ matrix.example }}.exe
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 wine64 ${{ matrix.example }}.exe &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID
- name: upload screenshots
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.example }}-wine.png
path: build/${{ matrix.example }}/screenshot.png

macos:
runs-on: macos-13

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
- name: install dependencies
run: |
wget https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.zip -O vulkan-sdk.zip
unzip vulkan-sdk.zip
Expand All @@ -194,7 +267,7 @@ jobs:
cd ~/vulkan/
python install_vulkan.py
- name: macos build
- name: build
run: |
git submodule update --recursive
./build.sh -o -d -r -t
Expand All @@ -207,7 +280,7 @@ jobs:
cp -r build/PerlinWorld demos/
cd demos && zip -r ../demos.zip * && cd ..
- name: Tests
- name: unit tests
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
Expand All @@ -225,51 +298,7 @@ jobs:
name: demomacos
path: demos.zip

linuxRun:
needs: linuxNative
runs-on: ubuntu-20.04

steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xvfb x11-apps imagemagick

- name: get linux demos
uses: actions/download-artifact@v4
with:
name: demoLinux

- name: launch and screenshot
run: |
unzip demos.zip
cd PerlinWorld
chmod +x PerlinWorld
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./PerlinWorld &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID
MESA_GL_VERSION_OVERRIDE=3.3 ./PerlinWorld map &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot-map.png
sleep 5 && kill $PID
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: screenshot
path: PerlinWorld/screenshot.png

- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: screenshot-map
path: PerlinWorld/screenshot-map.png

linuxXandroid:
android:
needs: [headers]
runs-on: ubuntu-20.04

Expand All @@ -278,7 +307,7 @@ jobs:
with:
submodules: 'recursive'

- name: Install dependencies
- name: install dependencies
run: |
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
wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
Expand All @@ -295,7 +324,7 @@ jobs:
./cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-34"
echo no | ./cmdline-tools/latest/bin/avdmanager create avd --name android34 --package "system-images;android-34;google_apis;x86_64"
- name: build hop
- name: build
run: |
git submodule update --recursive
./build.sh -r --android android-ndk-r25c
Expand Down Expand Up @@ -352,7 +381,7 @@ jobs:
# path: screenshot-android.png

test-release:
needs: [linuxNative, headers]
needs: [linux, headers]
runs-on: ubuntu-22.04

steps:
Expand All @@ -371,10 +400,10 @@ jobs:
with:
name: linuxbuild

- name: Install dependencies
- name: install dependencies
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

- name: linux lib test
- name: regression
run: |
ls
mv libHop-linux-x86_64.a libHop.a
Expand All @@ -388,7 +417,7 @@ jobs:
cmake .. && make
test-release-mingw:
needs: [linuxXwindows, headers]
needs: [windows, headers]
runs-on: ubuntu-22.04

steps:
Expand All @@ -407,10 +436,10 @@ jobs:
with:
name: windowsbuild

- name: Install dependencies
- name: install dependencies
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

- name: mingw lib test
- name: regression
run: |
ls
mv libHop-windows.a libHop.a
Expand All @@ -422,7 +451,7 @@ jobs:
./build.sh
test-release-macos:
needs: [macosNative, headers]
needs: [macos, headers]
runs-on: macos-13

steps:
Expand All @@ -441,7 +470,7 @@ jobs:
with:
name: macosbuild

- name: Install dependencies
- name: install dependencies
run: |
wget https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.zip -O vulkan-sdk.zip
unzip vulkan-sdk.zip
Expand All @@ -450,7 +479,7 @@ jobs:
cd ~/vulkan/
python install_vulkan.py
- name: macos lib test
- name: regression
run: |
ls
mv libHop-macos.a libHop.a
Expand All @@ -463,7 +492,7 @@ jobs:
cmake .. -DCMAKE_TOOLCHAIN_FILE=../osx.cmake && make
release:
needs: [linuxNative, linuxXwindows, linuxXandroid, macosNative, headers]
needs: [linux, windows, android, macos, headers]
if: github.ref_type == 'tag'
runs-on: ubuntu-20.04

Expand Down
Loading

0 comments on commit 9b2791a

Please sign in to comment.