Split workflows and add regressions #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Hop linux | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
linuxBuild: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- 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: pack headers | |
run: | | |
mkdir headers | |
for inc in include/jGL/include/jGL \ | |
include/jGL/include/*.h \ | |
include/jGL/include/vendored/freetype/include/* \ | |
include/jGL/include/vendored/glew/include/GL \ | |
include/jGL/include/vendored/glfw/include/GLFW \ | |
include/jGL/include/vendored/glm/glm \ | |
include/jGL/include/vendored/stduuid/include/uuid.h \ | |
include/jGL/include/vendored/stduuid/gsl \ | |
include/jGL/include/vendored/stb_image.h \ | |
include/jLog \ | |
include/jThread \ | |
include/Collision \ | |
include/Component \ | |
include/Console \ | |
include/Debug \ | |
include/Maths \ | |
include/Object \ | |
include/Shader \ | |
include/System \ | |
include/Util \ | |
include/World \ | |
include/vendored/lua/src/lauxlib.h \ | |
include/vendored/lua/src/lua.h \ | |
include/vendored/lua/src/luaconf.h \ | |
include/vendored/lua/src/lualib.h \ | |
include/vendored/miniaudio \ | |
include/vendored/json.hpp \ | |
include/*.h \ | |
include/vendored/vorbis/include/vorbis \ | |
include/vendored/ogg/include/ogg \ | |
include/vendored/sparsehash; | |
do cp -r $inc headers; done | |
- name: linux-linux | |
run: ./build.sh -t -d -r | |
- name: 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 | |
run: | | |
export DISPLAY=:99 | |
sudo Xvfb :99 -screen 0 800x600x24 & | |
sleep 5 | |
MESA_GL_VERSION_OVERRIDE=3.3 ctest --output-on-failure --verbose | |
linuxBuildAndRun: | |
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 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: linux-linux | |
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 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.example }}.png | |
path: build/${{ matrix.example }}/screenshot.png | |
- name: regression | |
run: | | |
mkdir tests/regression/user/include/ | |
cp build/*.a tests/regression/user/ | |
cp -r headers/* tests/regression/user/include/ | |
cd tests/regression/user | |
mkdir build && cd build | |
cmake .. && make |