108 lines
4.2 KiB
YAML
108 lines
4.2 KiB
YAML
name: Verify ShrinkSDK Package Hosts
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
catalog:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Validate submodules and version catalog
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
if ! command -v git >/dev/null 2>&1; then
|
|
apt-get update
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates git
|
|
fi
|
|
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
|
|
bash Tools/CI/Validate-Submodules.sh "$PWD"
|
|
node Tools/Release/update-shrinksdk-versions.mjs --check
|
|
|
|
editmode:
|
|
needs: catalog
|
|
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
|
|
bash Tools/CI/Validate-Submodules.sh "$PWD"
|
|
|
|
- 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
|
|
workspace_root="$(pwd)"
|
|
for relative_host in Assets/Modules/*/Development~/UnityProject; do
|
|
host="$workspace_root/$relative_host"
|
|
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 \
|
|
-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 (Unity exit status: ${status})" >&2
|
|
if test -s "$results_file"; then
|
|
echo "${package_name} test result summary:" >&2
|
|
sed -n '1,40p' "$results_file" >&2
|
|
else
|
|
echo "${package_name} did not produce a test result file." >&2
|
|
fi
|
|
echo "${package_name} relevant Unity diagnostics:" >&2
|
|
grep -in -E 'error CS|compilation failed|test.*(failed|failure)|exception|fatal|no tests were executed|failed to' "$log_file" \
|
|
| tail -n 160 >&2 || true
|
|
else
|
|
echo "${package_name} EditMode verification passed"
|
|
fi
|
|
echo "::endgroup::"
|
|
done
|
|
exit "$failed"
|