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

Support Private Package Registries in Project testing #271

Closed nvandessel closed 3 months ago

nvandessel commented 3 months ago

Context

With recent feature add to support private registries when testing packages, I believe we should also extend this support to testing projects as well. This should be a simple feature add with the scaffolding in place and working for packages.

Suggested solution

I believe all we would need to do is move the place where the .upmconfig.toml is made, to outside of the scope of the package exclusive logic in ubuntu/run_tests.sh. Since we're testing a project, it should be expected that the scoped registry settings would already be setup, so we would not need to worry about updating the manifest.json like we do with packages.

Considered alternatives

I believe my suggested solution is simple and low risk enough that I haven't put any major thought into alternatives. Alternatively a user could do this into another step in their CI workflow, but considering we already have the logic in place I see it as a QOL upgrade to using this action.

Additional details

The effort is extremely low here, so I'm going to implement this feature, and I'll open a PR and link it to this issue once done.

As of now, package testing is only supported on Linux runners, per this issue: https://github.com/game-ci/unity-test-runner/issues/224 I believe that's largely due to the use of jq, so we could introduce support for private registries on more platforms than just Linux. I was planning on just focusing on the one platform, but I could look into others as well.