Giter VIP home page Giter VIP logo

unity-orb's People

Contributors

ericribeiro avatar gableroux avatar hashbanggames avatar systemkmp avatar tadashi0713 avatar thedrhax14 avatar webbertakken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

unity-orb's Issues

Macos-Runner cannot use personal licence

Orb version

game-ci/[email protected]

Execution environment

  • Executor: 'unity/macos-runner'
  • Target platform: iOS
  • Unity Editor version: '2021.3.27f1'

Bug description

I created personal licence file (Job doesn't run with default licence installed on PC)
And I pass licence as base64 encoded file in 'unity-license-var-name'

When I start the job I get the error:
"No serial detected. Extracting it from the encoded license.
Password:
Too long with no output (exceeded 20m0s): context deadline exceeded"

Expected behavior

I expect that job start with licence provided and without error

Make return_license step in main job optional

Orb version:

1.0.0

What happened:

When running with the unity-orb job, the build may succeed but then the "return license" step will run and fail:

LICENSE SYSTEM [2022831 1:41:30] Error fetching https://license.unity3d.com/update/poll?cmd=3&tx_id=41355cad154aaa5bf83f36699f935631
serial was activated manually for this computer and can't be returned

LICENSE SYSTEM [2022831 1:42:0] Failed to return license: Unity license return request has timed out. Please verify that you are connected to the Internet and/or try again later.

This is with a personal license. I followed the steps here.

Expected behavior:

Well, ideally the Unity service wouldn't return an error, it'd just say "okay thanks but I can't do anything with that."

Additional Information:

This forced me to decompose the job into its constituent commands, but...I'd have to do that anyway for my other "persist_to_workspace" issues mentioned in my other ticket (#25).

But if it wasn't for that, I'd be happy with any of the following options:

  • Tell unity-orb I'm using a personal license, so it doesn't try to return it (since it was manually activated).
  • Tell unity-orb I'm using a manually-activated license directly, so it doesn't try to return it.
  • Have unity-orb check for "activated manually for this computer and can't be returned", or an HTTP status code (?), and ignore non-fatal errors from the Unity server.

Unity activation not properly supported anymore with support for GameCI Docker images version 3

Orb version

After 1.7.0

Execution environment

  • Executor: all of them
  • Target platform: all of them
  • Unity Editor version: all of them

Bug description

The activation process for Unity changed a bit concerning personal licenses and GameCI images in version 3. To properly support new Unity versions, we need to solve the activation issues.

How to reproduce

  1. Fork this repository
  2. Create a project on CircleCI and connect your fork to it
  3. Fill in some environment variables to run the jobs with actual activations for Unity

Expected behavior

With valid env variables, good credentials and a valid license, activation should pass.

Additional details

https://app.circleci.com/pipelines/github/game-ci/unity-orb/322/workflows/53a92683-693b-4590-96af-e637609074c6/jobs/4081

Detected OS: Linux.
The "build-method" parameter is empty. Falling back to the default build script.
++ xvfb-run --auto-servernum '--server-args=-screen 0 640x480x24' unity-editor -projectPath /root/project/Unity2D-Demo-Game-CI-CD/src -quit -batchmode -nographics -buildTarget StandaloneLinux64 -customBuildTarget StandaloneLinux64 -customBuildName StandaloneLinux64 -customBuildPath /root/project/Unity2D-Demo-Game-CI-CD/src/Builds/StandaloneLinux64/ -executeMethod BuildCommand.PerformBuild -logFile /dev/stdout
Unity Editor version:    2022.3.33f1 (b2c853adf198)
Branch:                  2022.3/staging
Build type:              Release
Batch mode:              YES
System name:             Linux
Distro version:          #63~20.04.1-Ubuntu SMP Mon Mar 25 10:28:36 UTC 2024
Kernel version:          5.15.0-1057-aws
Architecture:            x86_64
Available memory:        70717 MB
[Licensing::Module] Trying to connect to existing licensing client channel...
[Licensing::IpcConnector] Connection attempt to the License Client on channel: "LicenseClient-root" failed because channel doesn't exist; code: "0x80000002"
[Licensing::Module] Successfully launched the LicensingClient (PId: 273)
[Licensing::IpcConnector] Successfully connected to the License Client on channel: "LicenseClient-root" at "2024-06-12T19:03:01.653384Z"
[SignatureVerifier] Application signature verification not supported on this platform.
[Licensing::Client] Handshaking with LicensingClient:
  Version:                 1.15.4+eee609c
  Session Id:              65e5e50f375b4871a46eacf65f2b7953
  Correlation Id:          4ba3e9de9ae505afd71f05ce91f9204e
  External correlation Id: 5161085665695614536
  Machine Id:              D7nTUnjNAmtsUMcnoyrqkgIbYdM=
[Licensing::Module] Successfully connected to LicensingClient on channel: "LicenseClient-root" (connect: 0.61s, validation: 0.05s, handshake: 0.00s)
[Licensing::IpcConnector] Successfully connected to the License Notification on channel: "LicenseClient-root-notifications" at "2024-06-12T19:03:01.702255Z"
[Licensing::Module] Connected to LicensingClient (PId: 273, launch time: 0.00, total connection time: 0.66s)
[Licensing::Module] Error: Access token is unavailable; failed to update
[Licensing::Client] Successfully updated license
[Licensing::Client] Successfully resolved entitlements
[Licensing::Module] Error: License is not active (com.unity.editor.headless). HasEntitlements will fail.
Pro License: NO
Initialize udev device monitor.
No valid Unity Editor license found. Please activate your license.

Exited with code exit status 1

image version

Orb version

1.7.0

Execution environment

name: 'unity/ubuntu'
target_platform: 'android'
editor_version: '2022.3.15f1'

Bug description

Error response from daemon: manifest for unityci/editor:ubuntu-2022.3.15f1-android-2 not found: manifest unknown: manifest unknown

I saw that it was reported before for v1 here #58
it changed to 2 here #59
but why not specify the image version from the config file?
now there is no version 2 for 2022.3.15f1 it is 3.0.0

Allow custom execution method and custom arguments

Describe Request:

I would like the ability to run my own executeMethod instead of needing to use the one set by game-ci

I would also like to be-able to pass custom Env args through the console to the executeMethod

Examples:

Simple example is being able to pass an executeMethod and
-executeMethod MyNamespace.BatchMode.Build -buildType=development -version="1.2.3" -bn=123

This then in Unity would go to a build function where we can grab the command args to-do additional work. (Most common is inserting a BN or git hash for our QA to visually validate, buildtype for dev vs release, and sometimes triggering a build with specific scenes for specific debug testing)

namespace MyNamespace{
   public class BatchMode{
      Build(){
         string[] args = Environment.GetCommandLineArgs();
      }
}

Supporting Documentation Links:

From Eric Ribeiro on discord - link

That said, the proper way to do this is to make the executeMethod a parameter in the build job/command. We can do it in a similar fashion of the Builder Action: https://game.ci/docs/github/builder#buildmethod

WebGL fails with Docker the medium resource class

Orb version:

0.1.0

What happened:

The job fails with error code 137 when building a WebGL project on the Docker medium resource class. The error seems to be related to the container running out of memory: https://support.circleci.com/hc/en-us/articles/115014359648-Exit-code-137-Out-of-memory.

image

The same error doesn't occur with the Docker large resource class or above.

Expected behavior:

The orb executors should allow the users to specify the desired resource class. This fixes the WebGL error and enables users to take advantage of CircleCI's different resource classes.

Additional Information:

https://github.com/game-ci/unity-orb/tree/main/src/executors
https://github.com/CircleCI-Public/resource-class-preview-docs

Build shows success when "Build Unity Project" step fails

Orb version:

game-ci/[email protected]

What happened:

Running a circle ci cloud build shows success, but resulting artifact was 100 bytes.

Checking logs it showed on "Build Unity Project" at the bottom an error

Rebuilding Library because the metadata folder could not be found!
Initializing Microsoft Media Foundation failed.  It seems that the Microsoft Media Foundation is not installed on this machine or a newer version of Microsoft Media Foundation is required.  To install the necessary libraries please install the Media Feature Pack from https://www.microsoft.com/en-us/search/result.aspx?q=Media+Feature+Pack for your version of Windows.
[Package Manager] Done resolving packages in 22.46s seconds
An error occurred while resolving packages:
  Project has invalid dependencies:
    com.unity.render-pipelines.universal: Package [[email protected]] cannot be found
    com.unity.visualeffectgraph: Package [[email protected]] cannot be found

A re-import of the project may be required to fix the issue or a manual modification of C:/unity_project/Packages/manifest.json file.
Exiting without the bug reporter. Application will terminate with return code 1
CircleCI received exit code 0

Screenshot showing green checkmark and error code

image

Expected behavior:

CircleCI should show an error on "Build Unity Project" if an error is thrown during the process.

Additional Information:

The relevant Job configuration from our config.yml

workflows:
  build-unity-project:
    jobs:
       - unity/build:
          context: UnityLicense
          build-name: 'FusionX'
          build-target: 'StandaloneWindows64'
          compress: true
          executor:
            name: 'unity/windows-2019'
            size: 'large'
            editor_version: '2021.3.2f1'
            target_platform: 'windows-il2cpp'
          project-path: 'Unity'
          step-name: 'Build Unity Project'
          store-artifacts: true

Building Unity Project Times Out

Orb version:

1.1.0

What happened:

I am building an Android project with Unity 2021.3.6f1 at CircleCI. The framework terminates the job due to no output after 10 minutes.

Starting: /opt/unity/Editor/Data/Tools/netcorerun/netcorerun "/opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/AndroidPlayerBuildProgram.exe" "/opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/Bee:/opt/unity/Editor/Data/Tools/BuildPipeline" "Library/Bee/Player01afee0d.dag.json" "Library/Bee/Player01afee0d-inputdata.json" "Library/Bee/buildprogram2.traceevents"
WorkingDir: /root/project/android/unity_build
ExitCode: 0 Duration: 1s499ms
Starting: /opt/unity/Editor/Data/bee_backend --profile="Library/Bee/backend_profiler3.traceevents" --stdin-canary --dagfile="Library/Bee/Player01afee0d.dag" --continue-on-failure --dagfilejson="Library/Bee/Player01afee0d.dag.json" Player
WorkingDir: /root/project/android/unity_build
++++ trap_build_script_exit
++++ exit_status=0
++++ set +x
Compressing build artifacts...

Too long with no output (exceeded 10m0s): context deadline exceeded

It appears CircleCI supports customizing this timeout, but it must be passed through by the orb. See also: https://discuss.circleci.com/t/how-to-handle-no-output-timeout-in-orb-command/44934/2

Expected behavior:

Should build, or provide a way around the timeout.

Custom Output Name in CircleCI

Allow for the definition of a custom output name for the compressed file artifact. Allow for variables to used in that name as well.

To explain, the goal of the process is to eventually have all successful builds on the master branch upload automatically to a github release AND a cloud storage folder. For the last to happen the filename would need to be unique. While the workaround to put each file in a uniquely named folder would work it just creates another level of file nesting that is unneeded.

Save artifacts to workspace in cicrleCI

Please add the option to persist the artifacts to a local workspace so i can upload them to github or sharepoint or any other repo in a separate workflow job

Make store_artifacts optional

Describe Request:

I'm using this orb to build an artifact that's then persisted to a workspace for later processing by itch.io's butler. I have steps that look like this:

    steps:
      - checkout
      - unity/prepare-env
      - unity/build:
          build-name: MyGameWin64
          build-target: StandaloneWindows64
      - persist_to_workspace: 
          root: Builds
          paths:
            - StandaloneWindows64

However, unity/build automatically stores artifacts, using up valuable space in my free CircleCI account. So...it'd be cool if that was optional.

Examples:

Supporting Documentation Links:

Unity build fails to access private Git repositories in Docker environment

Orb version

1.6.0

Execution environment

  • Executor: unity/windows-2019
  • Target platform: windows-il2cpp
  • Unity Editor version: 2021.3.24f1

Bug description

The unity/build command fails to access private Git repositories due to lack of Git credential configuration in the Docker environment. This command works fine in Linux and MacOS execution environments.

How to reproduce

  • Set up a Unity project with dependencies on a private Git repository
  • Configure CircleCI to build the project using game-ci/unity orb
  • Observe failure in resolving private repositories during the build

Expected behavior

The build process should authenticate and access private Git repositories seamlessly, resolving all dependencies.

Additional details

Returned error:

An error occurred while resolving packages:
  Project has invalid dependencies:
    <git package>: Error when executing git command. Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

Currently, the script doesn't handle Git authentication for private repositories inside the Docker container, leading to failed builds when private dependencies are involved.

Examples on Orb Registry are Outdated

Orb version:

1.2.1

What happened:

When using the example "drop-in" code from the Orb Registry, https://circleci.com/developer/orbs/orb/game-ci/unity?version=1.2.0#usage-test_and_build_personal_license, the YAML does not validate and returns "Cannot find a definition for job named checkout" and "Cannot find a definition for job named build".

Expected behavior:

YAML should validate :)

Additional Information:

https://game.ci/docs/circleci/build should be up to date according to Eric Ribeiro, so this is just the Orb Registry that's outdated.

Linecoverage: No such file or directory

Bug description

When running editmode tests on circle ci I got this error : grep: Linecoverage: No such file or directory
When looking in the circle ci orb I saw this line 718 : grep "$unity_project_full_path"/"$PARAM_TEST_PLATFORM"-coverage/Report/Summary.xml Linecoverage
But if I'm right the grep command doesn't work like this it should be grep "string" path

How to reproduce

Run test on circle ci in editmode.
Here is my circle ci job :

  test:
    executor:
      name: 'unity/ubuntu'
      target_platform: 'android'
      editor_version: '2022.3.11f1'
      resource_class: 'large'
    steps:
      - custom_checkout
      - unity/prepare-env:
          project-path: '******'
      - unity/test:
          project-path: '******'
          test-platform: 'editmode'
          custom-parameters: '-buildTarget "Android" -disable-assembly-updater -coverageOptions "useProjectSettings"'

macOS runners are now failing with "Unity Hub: Bad CPU type in executable"

After changes in #72 some macOS related jobs are now failing with this:

font-mansalva                            vcam
font-manuale                             warcraft-logs-uploader
font-maple                               wins

You have 4 outdated formulae installed.

==> Downloading https://public-cdn.cloud.unity3d.com/hub/prod/UnityHubSetup.dmg
######################################################################### 100.0%
Warning: No checksum defined for cask 'unity-hub', skipping verification.
==> Installing Cask unity-hub
==> Moving App 'Unity Hub.app' to '/Applications/Unity Hub.app'
๐Ÿบ  unity-hub was successfully installed!
Unity Hub installed successfully.
npm WARN exec The following package was not found and will be installed: [email protected]
++ '/Applications/Unity Hub.app/Contents/MacOS/Unity Hub' -- --headless install --version 2022.3.33f1 --changeset b2c853adf198 --module mac-il2cpp --childModules
/bin/bash: line 65: /Applications/Unity Hub.app/Contents/MacOS/Unity Hub: Bad CPU type in executable
++ set +x
Could not install the Unity Editor.
Please try again or open an issue.
Something went wrong.
Please try again or open an issue.

Exited with code exit status 1

Any help would be appreciated :)

Allow custom parameters on test execution

Describe Request

I would like the ability to run my tests with filters, using testFilter, assemblyNames or testCategory from unity test framework command line arguments.

This way I could have distinct workflows where I run different test chunks based on what changed.

Suggested solution

Would be nice to have a parameter on orb like:

      - unity/test:
          name: 'test-linux'
          step-name: 'Check if the tests run and results are uploaded'
          unity-license-var-name: 'UNITY_ENCODED_LICENSE'
          unity-username-var-name: 'UNITY_USERNAME'
          unity-password-var-name: 'UNITY_PASSWORD'
          executor:
            name: 'unity/ubuntu'
            target_platform: 'linux-il2cpp'
            editor_version: '2021.3.1f1'
            resource_class: 'medium'
          project-path: 'Unity2D-Demo-Game-CI-CD/src'
          test-platform: 'playmode'
          test-filter: 'MyNamespace.Something.MyTest;MyNamespace.SomethingElse.MyTest2'
          test-category: 'Unit;Integration;AnythingElse;AnotherCategory'
          assembly-names: 'MyUnitTestAssembly;MyIntegrationAssembly;AnyOtherAssembly'
          context: unity

Note the 3 parameters that currently does not exists: test-filter, test-category and assembly-names

And the command executed by the job would be like:

${UNITY_EXECUTABLE} \
  -projectPath $UNITY_DIR \
  -runTests \
  -testPlatform $TEST_PLATFORM \
  -testResults $UNITY_DIR/$TEST_PLATFORM-results.xml \
  -logFile /dev/stdout \
  -batchmode \
  -nographics \
  -enableCodeCoverage \
  -coverageResultsPath $UNITY_DIR/$TEST_PLATFORM-coverage \
  -coverageOptions "generateAdditionalMetrics;generateHtmlReport;generateHtmlReportHistory;generateBadgeReport;" \
  -debugCodeOptimization
  -testFilter "MyNamespace.Something.MyTest;MyNamespace.SomethingElse.MyTest2"
  -assemblyNames "MyUnitTestAssembly;MyIntegrationAssembly;AnyOtherAssembly"
  -testCategory "Unit;Integration;AnythingElse;AnotherCategory"

Currently the test command is executed hard coded from the shells on each OS. Possibly need to extract this to outside and enable to pass parameters to it.

Additional details

Unity test framework testFilters
Unity test framework assemblyNames
Unity test framework testCategory

Windows Executor targeting Android platform

Orb version

Execution environment

  • Executor: unity/windows-2022
  • Target platform: android
  • Unity Editor version: 2022.3.4f1

Bug description

I am attempting to build my project on a Windows executor, targeting Android to build an apk. I need to build on Windows because of some 3rd party dependencies that need to be built on Windows.

It appears there is an image supporting what I need:
editor-windows-2022.3.4f1-android-3.1.0

Seen here: https://game.ci/docs/docker/versions/

However, this doesn't appear to be a supported configuration (there is no android option available here):
https://github.com/game-ci/unity-orb/blob/main/src/executors/windows-2022.yml#L12

So this is the error seen in Circle
Error calling executor: 'unity/windows-2022' Type error for argument target_platform: expected type: enum ("appletv" "base" "universal-windows-platform" "windows-il2cpp"), actual value: "android" (type string)

How to reproduce

Use this configuration

executor:
      name: unity/windows-2022
      editor_version: 2022.3.4f1
      target_platform: android

Expected behavior

I would expect it to use that image, why is that not supported?

Additional details

Unity 2020.3.44f1LTS new Project failed build with error

Orb version

1.4.0

Execution environment
linux

  • Executor: unity/ubuntu
  • Target platform: android, windows
  • Unity Editor version: 2020.3.44f1 LTS

Bug description

Failed to build a new project version 2020.3.44f1LTS

How to reproduce

Create a new project on 2020.3.44f1LTS
Use CircleCi Orb with Game Ci 1.4.0

Expected behavior

Additional details

CircleCi shows:

[/opt/unity/Editor/Data/Resources/PackageManager/Editor/com.unity.purchasing.udp-2.0.0.tgz] to the package cache:
EINVAL: invalid argument, fchown. No packages loaded.
Maybe permission error

Full Report:

[Package Manager] Server::Start -- Port 60657 was selected

COMMAND LINE ARGUMENTS:
/opt/unity/Editor/Unity
-batchmode
-projectPath
/root/project/.
-quit
-batchmode
-nographics
-buildTarget
Android
-customBuildTarget
Android
-customBuildName
Test
-customBuildPath
/root/project/./Builds/Android/
-executeMethod
BuildCommand.PerformBuild
-logFile
/dev/stdout
Successfully changed project path to: /root/project/.
/root/project
Using Asset Import Pipeline V2.
Player connection [139763510092544] Host "[IP] 192.168.0.3 [Port] 55496 [Flags] 2 [Guid] 3055742242 [EditorId] 3055742242 [Version] 1048832 [Id] LinuxEditor(16,192.168.0.3) [Debug] 1 [PackageName] LinuxEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]...

Player connection [139763510092544] Host "[IP] 192.168.0.3 [Port] 55496 [Flags] 2 [Guid] 3055742242 [EditorId] 3055742242 [Version] 1048832 [Id] LinuxEditor(16,192.168.0.3) [Debug] 1 [PackageName] LinuxEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]...

Rebuilding Library because the asset database could not be found!
[Package Manager] Done resolving packages with errors in 9.43s seconds
Failed to resolve packages: Failed to add editor bundled package [/opt/unity/Editor/Data/Resources/PackageManager/Editor/com.unity.purchasing.udp-2.0.0.tgz] to the package cache:
EINVAL: invalid argument, fchown. No packages loaded.

A re-import of the project may be required to fix the issue or a manual modification of /root/project/Packages/manifest.json file.

Exited with code exit status 1

Newer versions of Unity do not properly build using gameci and unity-orb

Orb version

1.6.0

Execution environment

  • Executor: unity/ubuntu
  • Target platform: android
  • Unity Editor version: 2021.3.30f1

Bug description

Cannot build in gameci using more recent unity versions, it errors out, saying it cannot find the manifest for unityci/editor:ubuntu-2021.3.30.f1-android-1 which does not exist on docker. unityci/editor:ubuntu-2021.3.30.f1-android-2 does exist, but I cannot find a way to change it to point to the correct docker image.

The file src/executors/ubuntu.yml looks like there's a hardcoded 1 in the docker image.

How to reproduce

  • Create a unity project using version 2021.3.30f1 and hook it up to circleci. Build the project using the unity orb. The build will immediately fail.

Expected behavior

The build should download the correct unity version from docker so it can continue building.

Additional details

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.