chore: fixing CI
This commit is contained in:
@@ -27,6 +27,8 @@ jobs:
|
||||
env:
|
||||
WIKI_REPO: git@gitea.appstack.me:nick/simian.wiki.git
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y rsync openssh-client
|
||||
git config --global user.name "Simian CI"
|
||||
git config --global user.email "ci@simian.local"
|
||||
git clone "$WIKI_REPO" wiki
|
||||
@@ -37,5 +39,5 @@ jobs:
|
||||
echo "No wiki changes"
|
||||
else
|
||||
git commit -m "Update wiki from docs (CI)"
|
||||
git push origin HEAD
|
||||
git push origin main
|
||||
fi
|
||||
|
||||
+1
-1
@@ -91,4 +91,4 @@ shader_fs = "shaders/toon.fs"
|
||||
uint root = Scene::Load("scenes/demo.toml");
|
||||
```
|
||||
|
||||
`Scene::Load` returns a root entity that parents all top-level entities. Entity id `0` can be valid in EnTT, so use `ECS::IsValid(root)` to check success.
|
||||
`Scene::Load` returns a root entity that parents all top-level entities. Use `ECS::IsValid(root)` to check success on the scene load.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "acutest.h"
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include "../include/ShaderManager.h"
|
||||
#include "../include/ModelManager.h"
|
||||
#include "../include/MaterialManager.h"
|
||||
@@ -9,12 +10,35 @@
|
||||
#include "../include/scripting/ResourceBindings.h"
|
||||
#include "raylib.h"
|
||||
|
||||
static void InitRaylibHidden() {
|
||||
static bool HasDisplay() {
|
||||
#if defined(_WIN32)
|
||||
return true;
|
||||
#elif defined(__APPLE__)
|
||||
return true;
|
||||
#else
|
||||
const char* display = std::getenv("DISPLAY");
|
||||
const char* wayland = std::getenv("WAYLAND_DISPLAY");
|
||||
return (display && *display) || (wayland && *wayland);
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool InitRaylibHidden() {
|
||||
const char* forceHeadless = std::getenv("SIMIAN_HEADLESS");
|
||||
if (forceHeadless && forceHeadless[0] == '1') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!HasDisplay()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!IsWindowReady()) {
|
||||
SetConfigFlags(FLAG_WINDOW_HIDDEN);
|
||||
InitWindow(1, 1, "simian_test");
|
||||
SetTargetFPS(60);
|
||||
}
|
||||
|
||||
return IsWindowReady();
|
||||
}
|
||||
|
||||
static void ShutdownRaylibHidden() {
|
||||
@@ -31,7 +55,10 @@ static std::filesystem::path WriteTempShader(const std::filesystem::path& dir, c
|
||||
}
|
||||
|
||||
void test_shader_manager(void) {
|
||||
InitRaylibHidden();
|
||||
if (!InitRaylibHidden()) {
|
||||
TEST_SKIP("No display available for raylib");
|
||||
return;
|
||||
}
|
||||
|
||||
std::filesystem::path tmpDir = std::filesystem::current_path() / "tmp_shader";
|
||||
std::filesystem::create_directories(tmpDir);
|
||||
@@ -70,7 +97,10 @@ void test_shader_manager(void) {
|
||||
}
|
||||
|
||||
void test_model_manager(void) {
|
||||
InitRaylibHidden();
|
||||
if (!InitRaylibHidden()) {
|
||||
TEST_SKIP("No display available for raylib");
|
||||
return;
|
||||
}
|
||||
|
||||
ModelManager modelManager;
|
||||
Mesh mesh = GenMeshCube(1.0f, 1.0f, 1.0f);
|
||||
@@ -113,7 +143,10 @@ void test_material_manager(void) {
|
||||
}
|
||||
|
||||
void test_resource_bindings_script(void) {
|
||||
InitRaylibHidden();
|
||||
if (!InitRaylibHidden()) {
|
||||
TEST_SKIP("No display available for raylib");
|
||||
return;
|
||||
}
|
||||
|
||||
std::filesystem::path tmpDir = std::filesystem::current_path() / "tmp_resource";
|
||||
std::filesystem::create_directories(tmpDir);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "acutest.h"
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include "../include/ECSComponents.h"
|
||||
#include "../include/SceneGraph.h"
|
||||
#include "../include/SceneLoader.h"
|
||||
@@ -10,12 +11,35 @@
|
||||
#include "raylib.h"
|
||||
#include "entt.hpp"
|
||||
|
||||
static void InitRaylibHidden() {
|
||||
static bool HasDisplay() {
|
||||
#if defined(_WIN32)
|
||||
return true;
|
||||
#elif defined(__APPLE__)
|
||||
return true;
|
||||
#else
|
||||
const char* display = std::getenv("DISPLAY");
|
||||
const char* wayland = std::getenv("WAYLAND_DISPLAY");
|
||||
return (display && *display) || (wayland && *wayland);
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool InitRaylibHidden() {
|
||||
const char* forceHeadless = std::getenv("SIMIAN_HEADLESS");
|
||||
if (forceHeadless && forceHeadless[0] == '1') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!HasDisplay()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!IsWindowReady()) {
|
||||
SetConfigFlags(FLAG_WINDOW_HIDDEN);
|
||||
InitWindow(1, 1, "simian_test_scene");
|
||||
SetTargetFPS(60);
|
||||
}
|
||||
|
||||
return IsWindowReady();
|
||||
}
|
||||
|
||||
static void ShutdownRaylibHidden() {
|
||||
@@ -70,7 +94,10 @@ void test_scenegraph_detach(void) {
|
||||
}
|
||||
|
||||
void test_scene_loader_basic(void) {
|
||||
InitRaylibHidden();
|
||||
if (!InitRaylibHidden()) {
|
||||
TEST_SKIP("No display available for raylib");
|
||||
return;
|
||||
}
|
||||
|
||||
entt::registry registry;
|
||||
ModelManager modelManager;
|
||||
|
||||
Reference in New Issue
Block a user