mirror of
https://github.com/game-ci/unity-test-runner.git
synced 2026-02-02 17:59:07 +08:00
Sync input with documentation (#155)
This commit is contained in:
@@ -9,11 +9,12 @@ async function action() {
|
||||
unityVersion,
|
||||
customImage,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
customParameters,
|
||||
sshAgent,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
checkName,
|
||||
} = Input.getFromUser();
|
||||
@@ -25,14 +26,15 @@ async function action() {
|
||||
|
||||
// Run docker image
|
||||
await Docker.run(actionImage, {
|
||||
workspace,
|
||||
unityVersion,
|
||||
workspace,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
customParameters,
|
||||
sshAgent,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
});
|
||||
} finally {
|
||||
|
||||
@@ -22,13 +22,13 @@ class Docker {
|
||||
unityVersion,
|
||||
workspace,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
customParameters,
|
||||
sshAgent,
|
||||
githubToken,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
} = parameters;
|
||||
|
||||
const command = `docker run \
|
||||
@@ -41,9 +41,9 @@ class Docker {
|
||||
--env UNITY_SERIAL \
|
||||
--env UNITY_VERSION="${unityVersion}" \
|
||||
--env PROJECT_PATH="${projectPath}" \
|
||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||
--env TEST_MODE="${testMode}" \
|
||||
--env ARTIFACTS_PATH="${artifactsPath}" \
|
||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||
--env GITHUB_REF \
|
||||
--env GITHUB_SHA \
|
||||
--env GITHUB_REPOSITORY \
|
||||
|
||||
@@ -17,29 +17,29 @@ class Input {
|
||||
// Input variables specified in workflow using "with" prop.
|
||||
const rawUnityVersion = getInput('unityVersion') || 'auto';
|
||||
const customImage = getInput('customImage') || '';
|
||||
const testMode = (getInput('testMode') || 'all').toLowerCase();
|
||||
const rawProjectPath = getInput('projectPath') || '.';
|
||||
const customParameters = getInput('customParameters') || '';
|
||||
const testMode = (getInput('testMode') || 'all').toLowerCase();
|
||||
const rawArtifactsPath = getInput('artifactsPath') || 'artifacts';
|
||||
const rawUseHostNetwork = getInput('useHostNetwork') || 'false';
|
||||
const customParameters = getInput('customParameters') || '';
|
||||
const sshAgent = getInput('sshAgent') || '';
|
||||
const gitPrivateToken = getInput('gitPrivateToken') || '';
|
||||
const githubToken = getInput('githubToken') || '';
|
||||
const checkName = getInput('checkName') || 'Test Results';
|
||||
const gitPrivateToken = getInput('gitPrivateToken') || '';
|
||||
|
||||
// Validate input
|
||||
if (!includes(this.testModes, testMode)) {
|
||||
throw new Error(`Invalid testMode ${testMode}`);
|
||||
}
|
||||
|
||||
if (!this.isValidFolderName(rawArtifactsPath)) {
|
||||
throw new Error(`Invalid artifactsPath "${rawArtifactsPath}"`);
|
||||
}
|
||||
|
||||
if (!this.isValidFolderName(rawProjectPath)) {
|
||||
throw new Error(`Invalid projectPath "${rawProjectPath}"`);
|
||||
}
|
||||
|
||||
if (!this.isValidFolderName(rawArtifactsPath)) {
|
||||
throw new Error(`Invalid artifactsPath "${rawArtifactsPath}"`);
|
||||
}
|
||||
|
||||
if (rawUseHostNetwork !== 'true' && rawUseHostNetwork !== 'false') {
|
||||
throw new Error(`Invalid useHostNetwork "${rawUseHostNetwork}"`);
|
||||
}
|
||||
@@ -56,14 +56,14 @@ class Input {
|
||||
unityVersion,
|
||||
customImage,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
customParameters,
|
||||
sshAgent,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
checkName,
|
||||
gitPrivateToken,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user