mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-05-31 13:56:13 -07:00
Compare commits
9 Commits
snyk-fix-e
...
feature/us
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4233b08bae | ||
|
|
2badde1790 | ||
|
|
eba50f7627 | ||
|
|
f8b20890d9 | ||
|
|
b57598a959 | ||
|
|
7b2ec07fc1 | ||
|
|
3d3a018c23 | ||
|
|
a12e3e829e | ||
|
|
2321712bb4 |
6
.github/workflows/build-tests-mac.yml
vendored
6
.github/workflows/build-tests-mac.yml
vendored
@@ -18,9 +18,9 @@ jobs:
|
||||
projectPath:
|
||||
- test-project
|
||||
unityVersion:
|
||||
- 2021.3.45f1
|
||||
- 2022.3.13f1
|
||||
- 2023.2.2f1
|
||||
- 2021.3.45f2
|
||||
- 2022.3.62f3
|
||||
- 2023.2.22f1
|
||||
targetPlatform:
|
||||
- StandaloneOSX # Build a MacOS executable
|
||||
- iOS # Build an iOS executable
|
||||
|
||||
6
.github/workflows/build-tests-ubuntu.yml
vendored
6
.github/workflows/build-tests-ubuntu.yml
vendored
@@ -48,9 +48,9 @@ jobs:
|
||||
projectPath:
|
||||
- test-project
|
||||
unityVersion:
|
||||
- 2021.3.32f1
|
||||
- 2022.3.13f1
|
||||
- 2023.2.2f1
|
||||
- 2021.3.45f2
|
||||
- 2022.3.62f3
|
||||
- 2023.2.22f1
|
||||
targetPlatform:
|
||||
- StandaloneOSX # Build a macOS standalone (Intel 64-bit) with mono backend.
|
||||
- StandaloneWindows64 # Build a Windows 64-bit standalone with mono backend.
|
||||
|
||||
6
.github/workflows/build-tests-windows.yml
vendored
6
.github/workflows/build-tests-windows.yml
vendored
@@ -18,9 +18,9 @@ jobs:
|
||||
projectPath:
|
||||
- test-project
|
||||
unityVersion:
|
||||
- 2021.3.32f1
|
||||
- 2022.3.13f1
|
||||
- 2023.2.2f1
|
||||
- 2021.3.45f2
|
||||
- 2022.3.62f3
|
||||
- 2023.2.22f1
|
||||
targetPlatform:
|
||||
- Android # Build an Android apk.
|
||||
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
||||
|
||||
@@ -21,9 +21,9 @@ permissions:
|
||||
checks: write
|
||||
statuses: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
# Note: no concurrency block here — when invoked via workflow_call, the caller
|
||||
# (integrity-check.yml) manages concurrency. For direct dispatch/cron, runs are
|
||||
# naturally serialized by GitHub's single-concurrency-per-ref default.
|
||||
|
||||
env:
|
||||
AWS_STACK_NAME: game-ci-team-pipelines
|
||||
|
||||
@@ -47,6 +47,10 @@ inputs:
|
||||
required: false
|
||||
default: ''
|
||||
description: 'Custom parameters to configure the build.'
|
||||
useHostNetwork:
|
||||
required: false
|
||||
default: false
|
||||
description: 'Initialises Docker using the host network. (Linux only)'
|
||||
versioning:
|
||||
required: false
|
||||
default: 'Semantic'
|
||||
|
||||
8
dist/index.js
generated
vendored
8
dist/index.js
generated
vendored
@@ -327,6 +327,7 @@ class BuildParameters {
|
||||
androidExportType: input_1.default.androidExportType,
|
||||
androidSymbolType: androidSymbolExportType,
|
||||
customParameters: input_1.default.customParameters,
|
||||
useHostNetwork: input_1.default.useHostNetwork,
|
||||
sshAgent: input_1.default.sshAgent,
|
||||
sshPublicKeysDirectoryPath: input_1.default.sshPublicKeysDirectoryPath,
|
||||
gitPrivateToken: input_1.default.gitPrivateToken ?? (await github_cli_1.GithubCliReader.GetGitHubAuthToken()),
|
||||
@@ -637,7 +638,7 @@ class Docker {
|
||||
return await (0, exec_1.exec)(runCommand, undefined, options);
|
||||
}
|
||||
static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) {
|
||||
const { workspace, actionFolder, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
||||
const { workspace, actionFolder, useHostNetwork, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
||||
const githubHome = node_path_1.default.join(runnerTempPath, '_github_home');
|
||||
if (!(0, node_fs_1.existsSync)(githubHome))
|
||||
(0, node_fs_1.mkdirSync)(githubHome);
|
||||
@@ -670,6 +671,7 @@ class Docker {
|
||||
? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro'
|
||||
: ''} \
|
||||
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
||||
${useHostNetwork ? '--net=host' : ''} \
|
||||
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
||||
${image} \
|
||||
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
||||
@@ -1382,6 +1384,10 @@ class Input {
|
||||
static get customParameters() {
|
||||
return Input.getInput('customParameters') ?? '';
|
||||
}
|
||||
static get useHostNetwork() {
|
||||
const input = Input.getInput('useHostNetwork') ?? false;
|
||||
return input === 'true';
|
||||
}
|
||||
static get versioningStrategy() {
|
||||
return Input.getInput('versioning') ?? 'Semantic';
|
||||
}
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -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