Files
Workspace/.gitea/workflows/package-hosts-verify.yml
T
cneicy add2af8ec1
Validate ShrinkSDK Workspace / unity (push) Failing after 3m1s
ci(workspace): mirror Git package dependencies
2026-08-26 07:08:30 +08:00

76 lines
2.9 KiB
YAML

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
git config --global url."https://ghfast.top/https://github.com/".insteadOf "https://github.com/"
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"