test(workspace): verify standalone package hosts
Validate ShrinkSDK Workspace / unity (push) Failing after 3m4s

This commit is contained in:
2026-08-26 07:02:45 +08:00
parent 0dfdcca9ba
commit ce4517ed0c
23 changed files with 96 additions and 21 deletions
+74
View File
@@ -0,0 +1,74 @@
name: Verify ShrinkSDK Package Hosts
on:
workflow_dispatch:
jobs:
editmode:
runs-on: unity-2022.3.62f3
container:
image: docker.1panel.live/unityci/editor:ubuntu-2022.3.62f3-windows-mono-3
volumes:
- /www/dk_project/bt-recovery/gitea/runner/seedskey-unity-license:/root/.local/share/unity3d/Unity
- /www/dk_project/bt-recovery/gitea/runner/seedskey-unity-entitlements:/root/.config/unity3d/Unity/licenses
permissions:
contents: read
env:
UNITY_VERSION: 2022.3.62f3
steps:
- name: Fetch exact Workspace revision and submodules
shell: bash
run: |
set -euo pipefail
ref="${{ gitea.sha }}"
git init .
git remote add origin "https://git.crash.work/ShrinkSDK/Workspace.git"
git fetch --depth=1 origin "$ref"
git checkout --detach FETCH_HEAD
git submodule sync --recursive
git submodule update --init --recursive
test "$(git submodule status --recursive | wc -l | tr -d ' ')" = "21"
test -z "$(git submodule status --recursive | grep '^-')"
- name: Run every standalone package EditMode host
shell: bash
run: |
set -euo pipefail
machine_id_file="/root/.local/share/unity3d/Unity/.machine-id"
if test -s "$machine_id_file"; then
cat "$machine_id_file" > /etc/machine-id
echo "Unity machine identity restored"
fi
unity_bin="$(command -v unity-editor || command -v unity || command -v Unity || true)"
test -n "$unity_bin"
"$unity_bin" -version | head -n 1 | grep -F "$UNITY_VERSION"
failed=0
for host in Assets/Modules/*/Development~/UnityProject; do
package_root="$(dirname "$(dirname "$host")")"
package_name="$(basename "$package_root")"
results_dir="$host/TestResults"
results_file="$results_dir/editmode.xml"
log_file="$results_dir/unity.log"
mkdir -p "$results_dir"
echo "::group::${package_name} EditMode"
status=0
"$unity_bin" \
-batchmode \
-nographics \
-quit \
-projectPath "$host" \
-runTests \
-testPlatform EditMode \
-testResults "$results_file" \
-logFile "$log_file" || status=$?
if test "$status" -ne 0 || ! test -s "$results_file" || ! grep -q 'result="Passed"' "$results_file"; then
failed=1
echo "${package_name} EditMode verification failed" >&2
tail -n 220 "$log_file" || true
else
echo "${package_name} EditMode verification passed"
fi
echo "::endgroup::"
done
exit "$failed"
@@ -273,6 +273,7 @@ jobs:
'com.cysharp.unitask' = 'https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#7c0f199fe0d3fc528024488ccd671e6c7b27745b'
$PackageName = 'file:../../..'
}
testables = @($PackageName)
}
$developmentRoot = Join-Path $PackageRoot 'Development~/UnityProject'
Write-Utf8File -Path (Join-Path $developmentRoot 'Packages/manifest.json') -Content (($manifest | ConvertTo-Json -Depth 12) + [Environment]::NewLine)