-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable running tests for other branches than main #11
Comments
Hey, I am not sure if this helps. But unity has a built-in system to get packages that are UPM compatible. https://docs.unity3d.com/ScriptReference/PackageManager.Client.html which is Client.Add() in a test can basically with the branch you wanna test can here is an example they have mentioned here to get access to a particular branch the syntax is "https://github.example.com/myuser/myrepository.git#my-branch" Do you think it's a good idea to make a base class that can basically Add setup then remove the package by just passing in the git+branch for the package and run it on the branch? or just GitHub actions basically detect with branch it's running on and based on that pull that branch for running it? PS: I am hoping I got the issue being tackled here. My apologies if I messed something up. New to contributing. |
@jaibeer72 thank you for your input, you are on the correct track I think! 😄 I didn't know about that Unity built-in-system - thanks for pointing that out - that is interesting feature but not sure if it makes things any more easier for us 🤔 The issue (if I remember correctly) is that the package that this template repository generates can only run tests on the main branch. How it works currently:
I think what you said is the easiest way to go about it right now:
So new github action would after checkout replace the line awesome-unity-package#main from ExampleUnityProject's manifest.json file with proper branch name: so awesome-unity-package#branch-name, Replace can be done inside github action with eg. linux sed command https://linuxhint.com/replace_string_in_file_bash/ This would enable running tests in eg. PR's with the correct branch - currently it can run the tests only after merge to main because it always checksout main. |
See manifest.json at https://github.com/3d-group/unity-package-template/blob/main/Samples/ExampleUnityProject/Packages/manifest.json
Currently tests work so that the package is imported via git url. This means main branch.
Perhaps there is syntax to allow cloning from different branch eg.
https://git-repository.git@branch
?It is possible to get current branch name inside github actions with github ref parameter.
See eg. https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
Or perhaps develop way to do this to the test runner action: game-ci/unity-test-runner#71
The text was updated successfully, but these errors were encountered: