Skip to content

Feature: Tooling to run tests for Unity packages #71

@antja0

Description

@antja0

Hi!

First of all, thanks to you and all contributors for this repository ❤️

Background

I'm currently open sourcing some Unity packages (tools etc.) from our company to be used with the new Unity Package Manager.
I'm using this repository's action to run tests for those packages.

Problem

It seems like Unity requires an Unity project to run tests.

To circumvent this problem I created an empty Unity project at my repository and ignored it with .npmignore file and just ran tests there using the projectPath variable.

But I cannot help thinking that it is a bit silly to include empty Unity project just for running tests 😄

Suggested solution

I think this could be automated and included in this action like so:

  1. Check if there is package.json in project root in order to detect if project is an upm (unity package manager) package.
    or perhaps this could be told via env variable?
  2. Create new Unity project (either copy it from somewhere or download from Unity website?)
  3. Edit manifest.json at UnityProject/Packages/

Add following lines to dependencies and testables sections:

{
  "dependencies": {
    "com.company.package": "https://github.com/company/repository.git"
  },
  "testables": [ "com.company.package" ]
}

Perhaps Unity project could also be cached for future action runs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions