game-ci / unity-test-runner

Run tests for any Unity project
https://github.com/marketplace/actions/unity-test-runner
MIT License
206 stars 135 forks source link

Feature: Allow `unityVersion` of `auto` for Package Testing #227

Open trudeaua21 opened 1 year ago

trudeaua21 commented 1 year ago

Context

For Unity project testing, an auto strategy is available, which will automatically pick up the Unity Editor version for the project being tested from that project's settings. However, for the first iteration of package testing, I didn't implement this feature.

It would be nice if the auto strategy were available for Package Testing as well.

Suggested solution

I think this can be accomplished by modifying the UnityVersionParser.read(projectPath) function. The modification could be to detect whether a package is being tested, and if so, parse the package's package.json for the Unity Editor version.

I believe the relevant fields in the package.json are unity and unityRelease - there are a couple of considerations to make with those fields:

Considered alternatives

n/a

Additional details

List of Unity Package Manifest (package.json) fields as of version 2023.2