Skip to content
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

Convert to a Unity project and add tests #308

Open
wants to merge 25 commits into
base: canary
Choose a base branch
from

Conversation

miikalo
Copy link
Collaborator

@miikalo miikalo commented Nov 7, 2021

This PR will turn the repo into a Unity project so that tests can be automated with GitHub Actions. The PR comes with a working GitHub workflow file.

Changing the structure to a Unity project will not bother openupm, because, from openupm docs:

"The master branch is usually a Unity project (with Assets folder). The package.json file is located at a sub-folder, for example Assets/package-name or Packages/com.namespace.package-name. Git tags are based on the master branch. Build pipelines will detect the location of the package.json file, and handle it correctly."

An admin with access to Secrets of the repo will have to add a Unity license as a secret called UNITY_LICENSE. This license can also be encrypted for extra security.

Use the Test Runner to run the sample tests. If IntelliSense is not working for you, try regenerating all project files from "Preferences > External Tools" in Unity with "Embedded packages" ticked.

@soraphis
Copy link
Collaborator

have not checked it out yet, but I like this change.

some questions, from a quick observation:

  • can openupm locate multiple packages within a single repo?
  • Do Packages that are located as folders within the Packages/ folder need to be added to the manifest file as local paths?

@AdamRamberg
Copy link
Collaborator

Same here, just been glancing over the PR. I like the idea and I believe we should convert the repo back to a Unity project. Some thoughts:

  • When structuring the packages I think we should follow Unity's proposed way of developing an embeded package: https://docs.unity3d.com/Manual/CustomPackages.html#EmbedMe
  • Not 100% sure where to put the /scripts, /docs and /website folders though. Would it be possible to run the Github action if the Unity project is a subfolder in the repo? If yes then we might want to structure it like this:
- /unity-atoms (Unity project)
- /scripts
- /docs
- website
  • If we make this change to the canary branch we will also need to make the exact same change to the v5 branch.

@miikalo
Copy link
Collaborator Author

miikalo commented Nov 10, 2021

have not checked it out yet, but I like this change.

some questions, from a quick observation:

  • can openupm locate multiple packages within a single repo?
  • Do Packages that are located as folders within the Packages/ folder need to be added to the manifest file as local paths?

Good questions. The directory structure of 'Packages' or the contained package.json files have not changed, so I believe it should work. I opened up Package Manager in Unity and it lists the Unity Atoms packages correctly there. That's why I didn't add them to the manifest file. Any packages with tests in them do need to be added into 'testables' in the manifest file though.

@miikalo
Copy link
Collaborator Author

miikalo commented Nov 10, 2021

Same here, just been glancing over the PR. I like the idea and I believe we should convert the repo back to a Unity project. Some thoughts:

  • When structuring the packages I think we should follow Unity's proposed way of developing an embeded package: https://docs.unity3d.com/Manual/CustomPackages.html#EmbedMe
  • Not 100% sure where to put the /scripts, /docs and /website folders though. Would it be possible to run the Github action if the Unity project is a subfolder in the repo? If yes then we might want to structure it like this:
- /unity-atoms (Unity project)
- /scripts
- /docs
- website
  • If we make this change to the canary branch we will also need to make the exact same change to the v5 branch.

I like this proposition, the structure in the PR looks a little off with the varying casing of the directories. I'll change it and follow the instructions as recommended by Unity. I think it's gonna look tidy when done.

@miikalo
Copy link
Collaborator Author

miikalo commented Nov 13, 2021

Alright, looks a bit different again. Should work all the same though.

@miikalo
Copy link
Collaborator Author

miikalo commented Jan 19, 2022

Ready to go 👍

@miikalo
Copy link
Collaborator Author

miikalo commented Jan 28, 2023

Sorry the update took this long, should be free of conflicts now

@AdamRamberg AdamRamberg modified the milestones: v4.4.6, v4.5.0 Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants