game-ci / unity-orb

Build and test Unity projects for several platforms using CircleCI.
https://circleci.com/developer/orbs/orb/game-ci/unity
MIT License
7 stars 12 forks source link

Build shows success when "Build Unity Project" step fails #33

Closed marchewitt closed 1 year ago

marchewitt commented 1 year ago

Orb version:

game-ci/unity@1.1.0

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 [com.unity.render-pipelines.universal@12.1.7] cannot be found
    com.unity.visualeffectgraph: Package [com.unity.visualeffectgraph@12.1.7] 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
marchewitt commented 1 year ago

Easy way to repo this is run a build without the target execute method BuildCommand.PerformBuild existing in your Unity application.

You'll receive this error in the build but the job will proceed as if successful

Aborting batchmode due to failure:
executeMethod method BuildCommand.PerformBuild threw exception.

Exiting without the bug reporter. Application will terminate with return code 1
CircleCI received exit code 0