mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-05-31 13:56:13 -07:00
Adds support for useHostNetwork the unity-builder (#828)
* fix: remove concurrency block from reusable workflow to prevent deadlock
When integrity-check.yml calls validate-orchestrator-integration.yml via
workflow_call, both workflows resolve github.workflow to the same name
("Integrity"), creating identical concurrency groups. GitHub detects this
as a deadlock and cancels the run.
Fix: remove concurrency from the reusable workflow entirely — the caller
already manages concurrency for the group.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add optional argument to action
* Add useHostNetwork to Input class
* Adds useHostNetwork to BuildParameters
* Uses useHostNetwork in docker arguments for the linux command
* Adds tests for Inputs
* Tests for Build Parameters
* Use latests unity version for Xcode compatibility with modern versions
* chore: rebuild dist after rebase onto main
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: frostebite <jas.f.ukcmti@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
d10fd10a95
commit
c7a43cde4d
@@ -219,5 +219,10 @@ describe('BuildParameters', () => {
|
||||
jest.spyOn(Input, 'customParameters', 'get').mockReturnValue(mockValue);
|
||||
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ customParameters: mockValue }));
|
||||
});
|
||||
|
||||
it.each([true, false])('returns the flag for useHostNetwork when %s', async (mockValue) => {
|
||||
jest.spyOn(Input, 'useHostNetwork', 'get').mockReturnValue(mockValue);
|
||||
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ useHostNetwork: mockValue }));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -47,6 +47,7 @@ class BuildParameters {
|
||||
public containerRegistryImageVersion!: string;
|
||||
|
||||
public customParameters!: string;
|
||||
public useHostNetwork!: boolean;
|
||||
public sshAgent!: string;
|
||||
public sshPublicKeysDirectoryPath!: string;
|
||||
public providerStrategy!: string;
|
||||
@@ -141,6 +142,7 @@ class BuildParameters {
|
||||
androidExportType: Input.androidExportType,
|
||||
androidSymbolType: androidSymbolExportType,
|
||||
customParameters: Input.customParameters,
|
||||
useHostNetwork: Input.useHostNetwork,
|
||||
sshAgent: Input.sshAgent,
|
||||
sshPublicKeysDirectoryPath: Input.sshPublicKeysDirectoryPath,
|
||||
gitPrivateToken: Input.gitPrivateToken ?? (await GithubCliReader.GetGitHubAuthToken()),
|
||||
|
||||
@@ -42,6 +42,7 @@ class Docker {
|
||||
const {
|
||||
workspace,
|
||||
actionFolder,
|
||||
useHostNetwork,
|
||||
runnerTempPath,
|
||||
sshAgent,
|
||||
sshPublicKeysDirectoryPath,
|
||||
@@ -85,6 +86,7 @@ class Docker {
|
||||
: ''
|
||||
} \
|
||||
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
||||
${useHostNetwork ? '--net=host' : ''} \
|
||||
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
||||
${image} \
|
||||
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
||||
|
||||
@@ -334,4 +334,22 @@ describe('Input', () => {
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('useHostNetwork', () => {
|
||||
it('returns the default value', () => {
|
||||
expect(Input.useHostNetwork).toStrictEqual(false);
|
||||
});
|
||||
|
||||
it('returns true when string true is passed', () => {
|
||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||
expect(Input.useHostNetwork).toStrictEqual(true);
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('returns false when string false is passed', () => {
|
||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||
expect(Input.useHostNetwork).toStrictEqual(false);
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -139,6 +139,12 @@ class Input {
|
||||
return Input.getInput('customParameters') ?? '';
|
||||
}
|
||||
|
||||
static get useHostNetwork(): boolean {
|
||||
const input = Input.getInput('useHostNetwork') ?? false;
|
||||
|
||||
return input === 'true';
|
||||
}
|
||||
|
||||
static get versioningStrategy(): string {
|
||||
return Input.getInput('versioning') ?? 'Semantic';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user