From 992d907b9cea56c0c928154e5f0ea07801bf2716 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 4 Dec 2024 18:46:31 +0100 Subject: [PATCH] Add initial test for game cooking (use one of the Flax Samples project) --- .github/data/ExitOnEsc.cs | 11 +++++++++ .github/workflows/cooking.yml | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/data/ExitOnEsc.cs create mode 100644 .github/workflows/cooking.yml diff --git a/.github/data/ExitOnEsc.cs b/.github/data/ExitOnEsc.cs new file mode 100644 index 000000000..a2abcdfe0 --- /dev/null +++ b/.github/data/ExitOnEsc.cs @@ -0,0 +1,11 @@ +using FlaxEngine; + +public class ExitOnEsc : Script +{ + /// + public override void OnUpdate() + { + // Exit as soon as game starts update loaded level + Engine.RequestExit(); + } +} diff --git a/.github/workflows/cooking.yml b/.github/workflows/cooking.yml new file mode 100644 index 000000000..558c620b5 --- /dev/null +++ b/.github/workflows/cooking.yml @@ -0,0 +1,44 @@ +name: Cooking +on: [push, pull_request] + +env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: false + +jobs: + + # Cooking on Windows + tests-windows: + name: Cooking (Windows) + runs-on: "windows-2022" + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Print .NET info + run: | + dotnet --info + dotnet workload --info + - name: Checkout LFS + run: | + git lfs version + git lfs pull + - name: Get Flax Samples + uses: actions/checkout@v3 + with: + fetch-depth: 1 + repository: FlaxEngine/FlaxSamples + path: FlaxSamples + - name: Build Editor + run: | + .\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor + - name: Cook Game + run: | + cp -f -v .github\data\ExitOnEsc.cs FlaxSamples\MaterialsFeaturesTour\Source\Game + .\Binaries\Editor\Win64\Development\FlaxEditor.exe -std -headless -mute -null -project "${GITHUB_WORKSPACE}\FlaxSamples\MaterialsFeaturesTour" -build "Development.Windows" + - name: Test Game + run: | + .\FlaxSamples\MaterialsFeaturesTour\Output\Windows\MaterialsFeaturesTour.exe" -std -headless -mute -null