unity-devkit 0.1.19__tar.gz → 0.1.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/PKG-INFO +1 -1
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/pyproject.toml +1 -1
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/dispatch_workflow_generator.py +14 -4
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/tests/test_dispatch_workflow_generator.py +21 -6
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/.gitignore +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/__init__.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/build_unity.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/ci_build_unity.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/compile_check_unity.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/install.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/license.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/license_restore.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/lock_unity.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/matrix.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/player_build.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/projects.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/py.typed +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/src/unity_devkit/test_unity.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/tests/fixtures/environment-dump.json +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/tests/test_build_player.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/tests/test_matrix.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/tests/test_prepare.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/tests/test_projects.py +0 -0
- {unity_devkit-0.1.19 → unity_devkit-0.1.20}/tests/test_run_unity_batchmode.py +0 -0
|
@@ -63,8 +63,8 @@ def unity_dispatch(
|
|
|
63
63
|
build_workflow: Annotated[
|
|
64
64
|
str,
|
|
65
65
|
typer.Option(
|
|
66
|
-
help="The build job's uses: value — the consumer's pinned build-unity.yml reference "
|
|
67
|
-
"(owner/repo/.github/workflows/build-unity.yml@sha, or ./.github/workflows/build-unity.yml inside unity-devkit)"
|
|
66
|
+
help="The build job's uses: value — the consumer's pinned build-unity-internal.yml reference "
|
|
67
|
+
"(owner/repo/.github/workflows/build-unity-internal.yml@sha, or ./.github/workflows/build-unity-internal.yml inside unity-devkit)"
|
|
68
68
|
),
|
|
69
69
|
],
|
|
70
70
|
environment_config_class: Annotated[
|
|
@@ -160,6 +160,11 @@ def render_dispatch_workflow(dump: EnvironmentDump, *, project: str, output: str
|
|
|
160
160
|
f"{dump.class_name} —"
|
|
161
161
|
)
|
|
162
162
|
|
|
163
|
+
workflow_call_input_blocks: list[tuple[str, str | None, list[str], str | None]] = [
|
|
164
|
+
("runner-labels", "JSON-encoded runs-on value", ["type: string"], "default: '\"ubuntu-latest\"'"),
|
|
165
|
+
("version", "Version string to stamp; empty builds unversioned", ["type: string"], "default: ''"),
|
|
166
|
+
]
|
|
167
|
+
|
|
163
168
|
lines = [
|
|
164
169
|
header,
|
|
165
170
|
"# edit the class, then regenerate this workflow.",
|
|
@@ -169,13 +174,18 @@ def render_dispatch_workflow(dump: EnvironmentDump, *, project: str, output: str
|
|
|
169
174
|
" workflow_dispatch:",
|
|
170
175
|
" inputs:",
|
|
171
176
|
*indent_lines([line for block in input_blocks for line in build_input_block(block)], 6),
|
|
177
|
+
" workflow_call:",
|
|
178
|
+
" inputs:",
|
|
179
|
+
*indent_lines([line for block in workflow_call_input_blocks for line in build_input_block(block)], 6),
|
|
172
180
|
"",
|
|
173
181
|
"jobs:",
|
|
174
182
|
" build:",
|
|
175
183
|
f" uses: {build_workflow}",
|
|
176
184
|
" with:",
|
|
177
|
-
"
|
|
178
|
-
"
|
|
185
|
+
" runner-labels: ${{ inputs.runner-labels || '\"ubuntu-latest\"' }}",
|
|
186
|
+
" version: ${{ inputs.version || '' }}",
|
|
187
|
+
" environment-preset: ${{ inputs['environment-preset'] || '' }}",
|
|
188
|
+
" development: ${{ inputs.development || false }}",
|
|
179
189
|
]
|
|
180
190
|
if transport_lines:
|
|
181
191
|
lines.append(" environment-fields: |-")
|
|
@@ -13,9 +13,7 @@ from unity_devkit.dispatch_workflow_generator import (
|
|
|
13
13
|
from unity_devkit.player_build import parse_environment_fields
|
|
14
14
|
|
|
15
15
|
FIXTURE_DUMP = Path(__file__).parent / "fixtures" / "environment-dump.json"
|
|
16
|
-
PINNED_BUILD_WORKFLOW =
|
|
17
|
-
"outernet-foundation/unity-devkit/.github/workflows/build-unity.yml@cfd487e0e19b3d98046a2680a210137ec0d32832"
|
|
18
|
-
)
|
|
16
|
+
PINNED_BUILD_WORKFLOW = "outernet-foundation/unity-devkit/.github/workflows/build-unity-internal.yml@cfd487e0e19b3d98046a2680a210137ec0d32832"
|
|
19
17
|
|
|
20
18
|
|
|
21
19
|
def load_fixture_dump() -> EnvironmentDump:
|
|
@@ -53,7 +51,7 @@ def test_render_states_the_override_law_once_on_the_preset_input() -> None:
|
|
|
53
51
|
assert "environment field" not in workflow
|
|
54
52
|
assert "empty keeps the preset value" not in workflow
|
|
55
53
|
assert "checked overrides the preset value" not in workflow
|
|
56
|
-
assert workflow.count("description:") ==
|
|
54
|
+
assert workflow.count("description:") == 5
|
|
57
55
|
|
|
58
56
|
|
|
59
57
|
def test_render_maps_field_types_to_dispatch_inputs_without_descriptions() -> None:
|
|
@@ -159,11 +157,28 @@ def test_rendered_workflow_is_valid_yaml() -> None:
|
|
|
159
157
|
"apiUrl",
|
|
160
158
|
"portNumber",
|
|
161
159
|
]
|
|
160
|
+
call_inputs = trigger["workflow_call"]["inputs"]
|
|
161
|
+
assert list(call_inputs) == ["runner-labels", "version"]
|
|
162
|
+
assert call_inputs["runner-labels"]["type"] == "string"
|
|
163
|
+
assert call_inputs["runner-labels"]["default"] == '"ubuntu-latest"'
|
|
164
|
+
assert call_inputs["version"]["type"] == "string"
|
|
165
|
+
assert call_inputs["version"]["default"] == ""
|
|
162
166
|
assert document["jobs"]["build"]["uses"] == PINNED_BUILD_WORKFLOW
|
|
163
167
|
assert document["jobs"]["build"]["secrets"] == "inherit"
|
|
164
168
|
with_block = document["jobs"]["build"]["with"]
|
|
165
|
-
assert with_block["
|
|
166
|
-
assert with_block["
|
|
169
|
+
assert with_block["runner-labels"] == "__EXPR_OPEN__ inputs.runner-labels || '\"ubuntu-latest\"' __EXPR_CLOSE__"
|
|
170
|
+
assert with_block["version"] == "__EXPR_OPEN__ inputs.version || '' __EXPR_CLOSE__"
|
|
171
|
+
assert with_block["environment-preset"] == "__EXPR_OPEN__ inputs['environment-preset'] || '' __EXPR_CLOSE__"
|
|
172
|
+
assert with_block["development"] == "__EXPR_OPEN__ inputs.development || false __EXPR_CLOSE__"
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def test_render_with_block_uses_or_defaults_for_dual_trigger_support() -> None:
|
|
176
|
+
workflow = render_fixture_workflow()
|
|
177
|
+
|
|
178
|
+
assert "runner-labels: ${{ inputs.runner-labels || '\"ubuntu-latest\"' }}" in workflow
|
|
179
|
+
assert "version: ${{ inputs.version || '' }}" in workflow
|
|
180
|
+
assert "environment-preset: ${{ inputs['environment-preset'] || '' }}" in workflow
|
|
181
|
+
assert "development: ${{ inputs.development || false }}" in workflow
|
|
167
182
|
|
|
168
183
|
|
|
169
184
|
def test_render_header_embeds_the_full_regen_command() -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|