diff --git a/.github/actions/godot-project-export/action.yml b/.github/actions/godot-project-export/action.yml new file mode 100644 index 0000000000..762122343b --- /dev/null +++ b/.github/actions/godot-project-export/action.yml @@ -0,0 +1,55 @@ +name: Export Godot project +description: Export a test Godot project. + +inputs: + bin: + description: The path to the Godot executable + required: true + +runs: + using: composite + steps: + - name: Import resources and export project + shell: sh + run: | + git clone --depth=1 https://github.com/godotengine/godot-tests.git /tmp/godot-tests + + echo "Exporting project for Linux (PCK)" + ${{ inputs.bin }} --headless --path /tmp/godot-tests/tests/test_project/ --export-pack "Linux" /tmp/test_project.pck 2>&1 | tee log.txt || true + GODOT_CHECK_CI_LOG_ALL_ERRORS=1 misc/scripts/check_ci_log.py log.txt + + echo "Exporting project for Linux (ZIP)" + ${{ inputs.bin }} --headless --path /tmp/godot-tests/tests/test_project/ --export-pack "Linux" /tmp/test_project.zip 2>&1 | tee log.txt || true + GODOT_CHECK_CI_LOG_ALL_ERRORS=1 misc/scripts/check_ci_log.py log.txt + + echo "Exporting project for Linux as dedicated server (PCK)" + ${{ inputs.bin }} --headless --path /tmp/godot-tests/tests/test_project/ --export-pack "Linux Server" /tmp/test_project_server.pck 2>&1 | tee log.txt || true + GODOT_CHECK_CI_LOG_ALL_ERRORS=1 misc/scripts/check_ci_log.py log.txt + + - name: Run project files from folder + shell: sh + run: | + xvfb-run ${{ inputs.bin }} --path /tmp/godot-tests/tests/test_project/ --language fr --resolution 64x64 --write-movie /tmp/test_project_folder.png --quit 2>&1 | tee log.txt || true + GODOT_CHECK_CI_LOG_ALL_ERRORS=1 misc/scripts/check_ci_log.py log.txt + + ${{ inputs.bin }} --headless --path /tmp/godot-tests/tests/test_project/ --quit 2>&1 | tee log.txt || true + GODOT_CHECK_CI_LOG_ALL_ERRORS=1 misc/scripts/check_ci_log.py log.txt + + - name: Run exported project PCK/ZIP + shell: sh + run: | + xvfb-run ${{ inputs.bin }} --main-pack /tmp/test_project.pck --language fr --resolution 64x64 --write-movie /tmp/test_project_pck.png --quit 2>&1 | tee log.txt || true + GODOT_CHECK_CI_LOG_ALL_ERRORS=1 misc/scripts/check_ci_log.py log.txt + + xvfb-run ${{ inputs.bin }} --main-pack /tmp/test_project.zip --language fr --resolution 64x64 --write-movie /tmp/test_project_zip.png --quit 2>&1 | tee log.txt || true + GODOT_CHECK_CI_LOG_ALL_ERRORS=1 misc/scripts/check_ci_log.py log.txt + + # Headless mode is implied for dedicated server PCKs. + ${{ inputs.bin }} --main-pack /tmp/test_project_server.pck --quit 2>&1 | tee log.txt || true + GODOT_CHECK_CI_LOG_ALL_ERRORS=1 misc/scripts/check_ci_log.py log.txt + + echo "Checking whether video output from project folder and exported project match..." + md5sum /tmp/test_project*.png | md5sum --check + + echo "Checking whether audio output from project folder and exported project match..." + md5sum /tmp/test_project*.wav | md5sum --check diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 496b7799b7..b722a07bc1 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -35,6 +35,7 @@ jobs: build-mono: true doc-test: true proj-conv: true + proj-export: true api-compat: true artifact: true # Validate godot-cpp compatibility on one arbitrary editor build. @@ -118,7 +119,7 @@ jobs: run: | sudo apt-get update sudo apt-get install libwayland-bin # TODO: Figure out somehow how to embed this one. - if [ "${{ matrix.proj-test }}" == "true" ]; then + if [ "${{ matrix.proj-test }}" == "true" -o "${{ matrix.proj-export }}" == "true" ]; then sudo apt-get install mesa-vulkan-drivers fi @@ -257,6 +258,13 @@ jobs: with: bin: ${{ matrix.bin }} + # Test project export + - name: Test project export + uses: ./.github/actions/godot-project-export + if: matrix.proj-export + with: + bin: ${{ matrix.bin }} + # Test the project converter - name: Test project converter uses: ./.github/actions/godot-converter-test diff --git a/misc/scripts/check_ci_log.py b/misc/scripts/check_ci_log.py index fb8f4a582d..8c6eba669d 100755 --- a/misc/scripts/check_ci_log.py +++ b/misc/scripts/check_ci_log.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import os import sys if len(sys.argv) < 2: @@ -57,6 +58,12 @@ if file_contents.find("Assertion failed") != -1: print("ERROR: Assertion failed in project, check execution log for more info") sys.exit(55) +if os.environ.get("GODOT_CHECK_CI_LOG_ALL_ERRORS"): + # If any occurrence of "ERROR:" is found in the log, we consider it a failure. + if file_contents.find("ERROR:") != -1: + print("ERROR: 'ERROR:' found in log and GODOT_CHECK_CI_LOG_ALL_ERRORS is set.") + sys.exit(56) + # For now Godot leaks a lot of rendering stuff so for now we just show info # about it and this needs to be re-enabled after fixing this memory leaks.