Skip to content

Adds support for useHostNetwork the unity-builder#828

Merged
frostebite merged 10 commits intogame-ci:mainfrom
lupidan:feature/useHostNetworkSupport
May 3, 2026
Merged

Adds support for useHostNetwork the unity-builder#828
frostebite merged 10 commits intogame-ci:mainfrom
lupidan:feature/useHostNetworkSupport

Conversation

@lupidan
Copy link
Copy Markdown
Contributor

@lupidan lupidan commented Apr 17, 2026

Changes

  • Adds optional useHostNetwork to action (to match unity's test runner)
  • Adds useHostNetwork to Input class
  • Adds useHostNetwork to BuildParameters class
  • Passes useHostNetwork parameter to docker command to add --net=host
  • Updates unity versions in workflow test for testing builds, so macos-latest can build them

This allows access, for example, to licensing servers that are inside a VPN, when VPN access is configured inside the Github Action

Test Builds in home repo

Checklist

Summary by CodeRabbit

  • New Features

    • Added a new useHostNetwork option to enable Docker host-networking on Linux.
  • Tests

    • Added unit tests covering the new option’s parsing and default behavior.
  • Chores

    • Updated CI build matrices to newer Unity editor versions for macOS, Ubuntu, and Windows.

@github-actions
Copy link
Copy Markdown

Cat Gif

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: edab8bb8-d2b9-4bd9-ae58-8f5070490721

📥 Commits

Reviewing files that changed from the base of the PR and between ac7de97 and 20cbbba.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (9)
  • .github/workflows/build-tests-mac.yml
  • .github/workflows/build-tests-ubuntu.yml
  • .github/workflows/build-tests-windows.yml
  • action.yml
  • src/model/build-parameters.test.ts
  • src/model/build-parameters.ts
  • src/model/docker.ts
  • src/model/input.test.ts
  • src/model/input.ts
✅ Files skipped from review due to trivial changes (5)
  • action.yml
  • .github/workflows/build-tests-windows.yml
  • src/model/build-parameters.test.ts
  • src/model/input.ts
  • src/model/input.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/build-tests-mac.yml
  • src/model/docker.ts
  • .github/workflows/build-tests-ubuntu.yml
  • src/model/build-parameters.ts

📝 Walkthrough

Walkthrough

Added a new boolean action input useHostNetwork (Linux-only), exposed via Input.useHostNetwork, included in BuildParameters, and used to conditionally add --net=host to the Linux Docker run command; accompanying unit tests and CI Unity version matrix updates were also included.

Changes

Host-network input + wiring

Layer / File(s) Summary
Action input declaration
action.yml
Adds inputs.useHostNetwork (boolean, default: false, description: "Initialises Docker using the host network. (Linux only)").
Input accessor
src/model/input.ts
Adds static get useHostNetwork() that reads useHostNetwork input and returns true only when input string equals 'true'.
Input tests
src/model/input.test.ts
Adds tests for default false, 'true' -> true, and 'false' -> false, asserting single core.getInput call for provided values.
Build parameters
src/model/build-parameters.ts
Adds useHostNetwork!: boolean property and wires useHostNetwork: Input.useHostNetwork into BuildParameters.create().
BuildParameters tests
src/model/build-parameters.test.ts
Parameterized test asserting BuildParameters.create() includes useHostNetwork matching Input.useHostNetwork for true/false.
Docker invocation
src/model/docker.ts
Linux docker run command builder now accepts useHostNetwork and conditionally appends --net=host when true; Windows path unchanged.

CI Unity version updates

Layer / File(s) Summary
Ubuntu workflow matrix
.github/workflows/build-tests-ubuntu.yml
Updates strategy.matrix.unityVersion to 2021.3.45f2, 2022.3.62f3, 2023.2.22f1.
Windows workflow matrix
.github/workflows/build-tests-windows.yml
Updates strategy.matrix.unityVersion to 2021.3.45f2, 2022.3.62f3, 2023.2.22f1.
macOS workflow matrix
.github/workflows/build-tests-mac.yml
Updates strategy.matrix.unityVersion to 2021.3.45f2, 2022.3.62f3, 2023.2.22f1.

Sequence Diagram(s)

sequenceDiagram
    participant Action as GitHub Action
    participant Input as Input
    participant Params as BuildParameters
    participant Docker as Docker Builder
    participant Engine as Docker Engine

    Action->>Input: read `useHostNetwork` input
    Input-->>Action: boolean value
    Action->>Params: BuildParameters.create() (includes useHostNetwork)
    Params-->>Action: build parameters object
    Action->>Docker: construct docker run command (passes useHostNetwork)
    Docker->>Docker: if useHostNetwork == true add `--net=host`
    Docker->>Engine: execute `docker run ...`
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • webbertakken
  • davidmfinol
  • GabLeRoux

Poem

🐰 I sniffed a flag beneath the log,
A hop through Input, Params, and Docker fog,
On Linux I shout, "--net=host!" with glee,
Now containers mingle right with me,
I munch a carrot, then jiggle a cog 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change—adding useHostNetwork support to unity-builder—and is directly related to the changeset.
Description check ✅ Passed The description covers all required template sections: Changes are detailed, related issues/docs are linked, test builds are provided, and the checklist is completed with appropriate notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 6/8 reviews remaining, refill in 12 minutes and 51 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.89%. Comparing base (d10fd10) to head (20cbbba).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/model/docker.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #828      +/-   ##
==========================================
+ Coverage   70.87%   70.89%   +0.01%     
==========================================
  Files          28       28              
  Lines         872      876       +4     
  Branches      237      239       +2     
==========================================
+ Hits          618      621       +3     
- Misses        254      255       +1     
Files with missing lines Coverage Δ
src/model/build-parameters.ts 92.42% <ø> (ø)
src/model/input.ts 88.81% <100.00%> (+0.22%) ⬆️
src/model/docker.ts 9.80% <0.00%> (-0.20%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
action.yml (1)

50-53: Nit: quote the default to match other boolean inputs.

Other boolean-like inputs in this file use quoted string defaults (e.g., 'false' for runAsHostUser, resourceTracking, cacheUnityInstallationOnMac, skipActivation). GitHub Actions input values are always strings, so using an unquoted YAML boolean false here is inconsistent with the rest of the file.

Proposed change
   useHostNetwork:
     required: false
-    default: false
+    default: 'false'
     description: 'Initialises Docker using the host network. (Linux only)'

Also consider documenting this input in the README as the PR description notes docs weren't yet updated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@action.yml` around lines 50 - 53, The useHostNetwork input uses an unquoted
YAML boolean false; change its default to the quoted string 'false' to match
other boolean-like inputs (e.g., runAsHostUser, resourceTracking) and maintain
consistency because GitHub Actions inputs are strings; also add a short entry
documenting useHostNetwork in the README to reflect the new input.
src/model/docker.ts (1)

89-89: Consider warning when useHostNetwork is set on non-Linux platforms.

useHostNetwork is silently ignored on Windows (getWindowsCommand doesn't destructure or use it). The action.yml description already marks this Linux-only, but a core.warning when the flag is truthy on a non-Linux host would help users debug misconfigurations rather than wondering why --net=host isn't being applied.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/model/docker.ts` at line 89, The template includes useHostNetwork but on
non-Linux hosts that flag is ignored (getWindowsCommand doesn't use it); add a
runtime warning when useHostNetwork is true and process.platform !== 'linux' so
users know the flag will be ignored. Locate the code that builds the docker
command (the template line with ${useHostNetwork ? '--net=host' : ''}) and/or
getWindowsCommand, import and call core.warning (from `@actions/core`) when
useHostNetwork is truthy on non-Linux platforms, with a short message indicating
that --net=host is Linux-only and will be ignored on this OS.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@action.yml`:
- Around line 50-53: The useHostNetwork input uses an unquoted YAML boolean
false; change its default to the quoted string 'false' to match other
boolean-like inputs (e.g., runAsHostUser, resourceTracking) and maintain
consistency because GitHub Actions inputs are strings; also add a short entry
documenting useHostNetwork in the README to reflect the new input.

In `@src/model/docker.ts`:
- Line 89: The template includes useHostNetwork but on non-Linux hosts that flag
is ignored (getWindowsCommand doesn't use it); add a runtime warning when
useHostNetwork is true and process.platform !== 'linux' so users know the flag
will be ignored. Locate the code that builds the docker command (the template
line with ${useHostNetwork ? '--net=host' : ''}) and/or getWindowsCommand,
import and call core.warning (from `@actions/core`) when useHostNetwork is truthy
on non-Linux platforms, with a short message indicating that --net=host is
Linux-only and will be ignored on this OS.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 59743899-61eb-4a79-9381-800dc8305a25

📥 Commits

Reviewing files that changed from the base of the PR and between 4a7fc08 and 7db9620.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (6)
  • action.yml
  • src/model/build-parameters.test.ts
  • src/model/build-parameters.ts
  • src/model/docker.ts
  • src/model/input.test.ts
  • src/model/input.ts

Comment thread .github/workflows/build-tests-mac.yml
frostebite and others added 9 commits May 3, 2026 17:18
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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@frostebite frostebite force-pushed the feature/useHostNetworkSupport branch from ac7de97 to 4233b08 Compare May 3, 2026 17:05
@frostebite frostebite self-requested a review May 3, 2026 17:07
@frostebite
Copy link
Copy Markdown
Member

LGTM

@frostebite frostebite merged commit c7a43cd into game-ci:main May 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants