fix test
Unity CI / Unity Edit Mode tests (push) Failing after 9m58s

This commit is contained in:
Sebastian Kaindl
2026-08-05 13:06:04 +02:00
parent 07970be5a3
commit 2228c7aa45
+33 -11
View File
@@ -7,6 +7,8 @@ jobs:
name: Unity Edit Mode tests
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: unityci/editor:ubuntu-6000.5.6f1-base-3
steps:
- name: Check out project
uses: actions/checkout@v4
@@ -21,22 +23,42 @@ jobs:
restore-keys: |
unity-library-6000.5.6f1-
- name: Run Unity Edit Mode tests
id: unity-tests
uses: game-ci/unity-test-runner@v4
- name: Install Unity license
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: .
unityVersion: 6000.5.6f1
testMode: EditMode
artifactsPath: artifacts/edit-mode
run: |
if [ -z "${UNITY_LICENSE:-}" ]; then
echo "UNITY_LICENSE is not configured in the Gitea Actions secrets."
exit 1
fi
install -d -m 700 /root/.local/share/unity3d/Unity
printf '%s' "$UNITY_LICENSE" | tr -d '\r' > /root/.local/share/unity3d/Unity/Unity_lic.ulf
chmod 600 /root/.local/share/unity3d/Unity/Unity_lic.ulf
- name: Run Unity Edit Mode tests
run: |
mkdir -p artifacts/edit-mode
set -o pipefail
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
unity-editor \
-batchmode \
-nographics \
-projectPath "$PWD" \
-runTests \
-testPlatform EditMode \
-testResults "$PWD/artifacts/edit-mode/results.xml" \
-logFile - \
2>&1 | tee artifacts/edit-mode/unity.log
test -s artifacts/edit-mode/results.xml
grep -q '<test-run .*result="Passed"' artifacts/edit-mode/results.xml
- name: Remove Unity license
if: always()
run: rm -f /root/.local/share/unity3d/Unity/Unity_lic.ulf
- name: Upload Unity test results
if: always()
uses: actions/upload-artifact@v4
with:
name: unity-edit-mode-test-results
path: ${{ steps.unity-tests.outputs.artifactsPath }}
path: artifacts/edit-mode