mirror of
https://github.com/game-ci/unity-test-runner.git
synced 2026-02-05 03:39:06 +08:00
Add support for Scoped Registries (#261)
* add: new inputs and method params * feat: add scoped registry to manifest * feat: setup test job * fix(workflow): revert change from license to serial * feat: support private scoped registries * fix: multiple scopes
This commit is contained in:
@@ -22,6 +22,8 @@ export async function run() {
|
||||
checkName,
|
||||
packageMode,
|
||||
packageName,
|
||||
scopedRegistryUrl,
|
||||
registryScopes,
|
||||
chownFilesTo,
|
||||
dockerCpuLimit,
|
||||
dockerMemoryLimit,
|
||||
@@ -55,6 +57,8 @@ export async function run() {
|
||||
sshPublicKeysDirectoryPath,
|
||||
packageMode,
|
||||
packageName,
|
||||
scopedRegistryUrl,
|
||||
registryScopes,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
chownFilesTo,
|
||||
|
||||
@@ -38,6 +38,9 @@ class ImageEnvironmentFactory {
|
||||
{ name: 'ARTIFACTS_PATH', value: parameters.artifactsPath },
|
||||
{ name: 'PACKAGE_MODE', value: parameters.packageMode },
|
||||
{ name: 'PACKAGE_NAME', value: parameters.packageName },
|
||||
{ name: 'SCOPED_REGISTRY_URL', value: parameters.scopedRegistryUrl },
|
||||
{ name: 'REGISTRY_SCOPES', value: parameters.registryScopes },
|
||||
{ name: 'PRIVATE_REGISTRY_TOKEN', value: process.env.UPM_REGISTRY_TOKEN },
|
||||
{ name: 'GIT_PRIVATE_TOKEN', value: parameters.gitPrivateToken },
|
||||
{ name: 'VERSION', value: parameters.buildVersion },
|
||||
{ name: 'CUSTOM_PARAMETERS', value: parameters.customParameters },
|
||||
|
||||
@@ -101,6 +101,9 @@ class Input {
|
||||
const checkName = getInput('checkName') || 'Test Results';
|
||||
const rawPackageMode = getInput('packageMode') || 'false';
|
||||
let packageName = '';
|
||||
const scopedRegistryUrl = getInput('scopedRegistryUrl') || '';
|
||||
const rawScopes = getInput('registryScopes') || '';
|
||||
let registryScopes: string[] = [];
|
||||
const chownFilesTo = getInput('chownFilesTo') || '';
|
||||
const dockerCpuLimit = getInput('dockerCpuLimit') || os.cpus().length.toString();
|
||||
const bytesInMegabyte = 1024 * 1024;
|
||||
@@ -171,6 +174,16 @@ class Input {
|
||||
|
||||
packageName = this.getPackageNameFromPackageJson(projectPath);
|
||||
this.verifyTestsFolderIsPresent(projectPath);
|
||||
|
||||
if (scopedRegistryUrl !== '') {
|
||||
if (rawScopes === '') {
|
||||
throw new Error(
|
||||
'Scoped registry is set, but registryScopes is not set. registryScopes is required when using scopedRegistryUrl.',
|
||||
);
|
||||
}
|
||||
|
||||
registryScopes = rawScopes.split(',').map(scope => scope.trim());
|
||||
}
|
||||
}
|
||||
|
||||
if (runAsHostUser !== 'true' && runAsHostUser !== 'false') {
|
||||
@@ -219,6 +232,8 @@ class Input {
|
||||
checkName,
|
||||
packageMode,
|
||||
packageName,
|
||||
scopedRegistryUrl,
|
||||
registryScopes,
|
||||
chownFilesTo,
|
||||
dockerCpuLimit,
|
||||
dockerMemoryLimit,
|
||||
|
||||
Reference in New Issue
Block a user