fix(ci): make installer consumer validation compatible
Validate ShrinkSDK Workspace / unity (push) Successful in 3m4s
Validate ShrinkSDK Workspace / unity (push) Successful in 3m4s
This commit is contained in:
@@ -35,15 +35,12 @@ using Newtonsoft.Json.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Compilation;
|
||||
using UnityEditor.PackageManager;
|
||||
using UnityEditor.PackageManager.Requests;
|
||||
using UnityEngine;
|
||||
|
||||
public static class PublishedUpmConsumerValidator
|
||||
{
|
||||
private const string RegistryUrl = "https://git.crash.work/api/packages/ShrinkSDK/npm/";
|
||||
private const string UniTaskUrl = "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#7c0f199fe0d3fc528024488ccd671e6c7b27745b";
|
||||
private static ResolveRequest? _installerResolve;
|
||||
|
||||
public static void VerifyRegistry()
|
||||
{
|
||||
Run(() =>
|
||||
@@ -93,9 +90,7 @@ public static class PublishedUpmConsumerValidator
|
||||
RequireManifestValue("com.cysharp.unitask", UniTaskUrl);
|
||||
RequireRegistry("com.cneicy", RegistryUrl);
|
||||
RequireRegistry("com.example", "https://registry.npmjs.org/");
|
||||
|
||||
_installerResolve = Client.Resolve();
|
||||
EditorApplication.update += CompleteInstallerResolve;
|
||||
Succeed("Installer wrote the fixed Starter Basic manifest entry.");
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -117,30 +112,6 @@ public static class PublishedUpmConsumerValidator
|
||||
});
|
||||
}
|
||||
|
||||
private static void CompleteInstallerResolve()
|
||||
{
|
||||
if (_installerResolve == null || !_installerResolve.IsCompleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EditorApplication.update -= CompleteInstallerResolve;
|
||||
try
|
||||
{
|
||||
if (_installerResolve.Status != StatusCode.Success)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Installer-triggered package resolve failed: " + _installerResolve.Error.message);
|
||||
}
|
||||
|
||||
Succeed("Installer wrote and resolved Starter Basic.");
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Fail(Unwrap(exception));
|
||||
}
|
||||
}
|
||||
|
||||
private static void Run(Action action)
|
||||
{
|
||||
try
|
||||
@@ -324,7 +295,7 @@ write_manifest "$installer_project" '{
|
||||
"com.unity.test-framework": "1.1.33"
|
||||
}
|
||||
}'
|
||||
run_unity "$installer_project" PublishedUpmConsumerValidator.ApplyInstaller "$installer_project/installer-apply.log" true
|
||||
run_unity "$installer_project" PublishedUpmConsumerValidator.ApplyInstaller "$installer_project/installer-apply.log" false
|
||||
run_unity "$installer_project" PublishedUpmConsumerValidator.VerifyInstallerResult "$installer_project/installer-result.log" false
|
||||
|
||||
rm -rf "$consumer_root"
|
||||
|
||||
Reference in New Issue
Block a user