name: Validate ShrinkSDK Workspace on: push: branches: - main workflow_dispatch: jobs: unity: 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 module_count="$(git submodule status --recursive | wc -l | tr -d ' ')" test "$module_count" = "21" test -z "$(git submodule status --recursive | grep '^-')" git submodule status --recursive - name: Compile Workspace and validate package graph shell: bash run: | set -euo pipefail ulf_file="/root/.local/share/unity3d/Unity/Unity_lic.ulf" machine_id_file="/root/.local/share/unity3d/Unity/.machine-id" entitlement_file="/root/.config/unity3d/Unity/licenses/UnityEntitlementLicense.xml" if test -s "$ulf_file"; then echo "Unity license mount: ULF present" elif test -s "$entitlement_file"; then echo "Unity license mount: entitlement present" else echo "No Unity license file is available through the configured mounts." >&2 exit 1 fi 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" mkdir -p Artifacts "$unity_bin" -version | head -n 1 | grep -F "$UNITY_VERSION" status=0 "$unity_bin" \ -batchmode \ -nographics \ -quit \ -projectPath "$PWD" \ -executeMethod ShrinkSDK.WorkspaceValidation.ShrinkSdkWorkspaceValidation.Run \ -logFile "$PWD/Artifacts/unity-workspace-validation.log" || status=$? tail -n 240 "$PWD/Artifacts/unity-workspace-validation.log" || true exit "$status"