Adding useHostNetwork option
parent
f02586c1c9
commit
a4e8475a2f
12
README.md
12
README.md
|
@ -231,6 +231,18 @@ In this folder a folder will be created for every test mode.
|
|||
_**required:** `false`_
|
||||
_**default:** `artifacts`_
|
||||
|
||||
#### useHostNetwork
|
||||
|
||||
Initializes Docker using the host network.
|
||||
|
||||
This is useful if Unity needs to access a local server that was started as part of your workflow.
|
||||
|
||||
Options are: "true", "false"
|
||||
|
||||
_**required:** `false`_
|
||||
_**default:** `false`_
|
||||
|
||||
|
||||
#### customParameters
|
||||
|
||||
Custom parameters to configure the test runner.
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -10,6 +10,7 @@ async function action() {
|
|||
projectPath,
|
||||
testMode,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
customParameters,
|
||||
} = Input.getFromUser();
|
||||
const baseImage = ImageTag.createForBase(unityVersion);
|
||||
|
@ -24,6 +25,7 @@ async function action() {
|
|||
projectPath,
|
||||
testMode,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
customParameters,
|
||||
});
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ class Docker {
|
|||
projectPath,
|
||||
testMode,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
customParameters,
|
||||
} = parameters;
|
||||
|
||||
|
@ -60,6 +61,7 @@ class Docker {
|
|||
--volume "/home/runner/work/_temp/_github_home":"/github/home" \
|
||||
--volume "/home/runner/work/_temp/_github_workflow":"/github/workflow" \
|
||||
--volume "${workspace}":"/github/workspace" \
|
||||
${useHostNetwork ? '--net=host' : ''} \
|
||||
${image}`;
|
||||
|
||||
await exec(command, null, { silent });
|
||||
|
|
|
@ -18,6 +18,7 @@ class Input {
|
|||
const testMode = getInput('testMode') || 'all';
|
||||
const rawProjectPath = getInput('projectPath') || '.';
|
||||
const rawArtifactsPath = getInput('artifactsPath') || 'artifacts';
|
||||
const rawUseHostNetwork = getInput('useHostNetwork') || 'false';
|
||||
const customParameters = getInput('customParameters') || '';
|
||||
|
||||
// Validate input
|
||||
|
@ -33,9 +34,14 @@ class Input {
|
|||
throw new Error(`Invalid projectPath "${rawProjectPath}"`);
|
||||
}
|
||||
|
||||
if (rawUseHostNetwork !== 'true' && rawUseHostNetwork !== 'false') {
|
||||
throw new Error(`Invalid useHostNetwork "${rawUseHostNetwork}"`);
|
||||
}
|
||||
|
||||
// Sanitise input
|
||||
const projectPath = rawProjectPath.replace(/\/$/, '');
|
||||
const artifactsPath = rawArtifactsPath.replace(/\/$/, '');
|
||||
const useHostNetwork = rawUseHostNetwork === 'true';
|
||||
|
||||
// Return sanitised input
|
||||
return {
|
||||
|
@ -43,6 +49,7 @@ class Input {
|
|||
projectPath,
|
||||
testMode,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
customParameters,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue