-
Notifications
You must be signed in to change notification settings - Fork 3
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
[REG-1495] Reorganize Unity projects and add CI/CD #121
Conversation
@analogrelay I went and add the Unity license to the UNITY_LICENSE secret in GitHub Actions for this repository - let me know if you need any other permissions, but I believe that should work... |
I think that's all I needed, but I'll let you know! |
fe5127f
to
ebdd47e
Compare
ebdd47e
to
594fd78
Compare
@analogrelay For the projects we have that reference the sdk by relative path, the PRs for the update can be made beside this for review (that's what I've generally done in the past so they can all merge near in time) BossRoom For the GIT reference projects.... needing to update to the latest commit after merging is annoying and prevents the early PRs for the most part. IIRC I think I used unity's package manager to update those hashes after merging last time but there are other ways to do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
If we don't have at least one gotcha from this I'll be amazed/impressed, but only one way to find out for sure. Merge it 👍
I wonder if in the future we can do another pass where we put the sample projects we wish to ship in an easier to manipulate location and package them into the SDK during the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very excited about the possibilities this opens up...
Just to confirm one thing though - when we download via git for the package, it was unclear to me whether the game samples also would be downloaded? Now that I think about it, even though we can define a folder, would the git clone still pull everything?
- name: Run Unity Tests | ||
id: run-unity-tests | ||
uses: game-ci/unity-test-runner@v4 | ||
env: | ||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
with: | ||
projectPath: src/RGUnityBots | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So right now this will only run the tests in the SDK, correct? And in the future how should we run tests that are in the games? Also I am guessing we will have a README in this project that mentions things like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This builds and run tests on the host project src/RGUnityBots
. Ideally, this should be where all our tests live. If we need scenes or assets for test scenarios, I'd suggest they mostly live in src/RGUnityBots
so that they aren't expected to be both useful tests and useful samples (as those scenarios can be different).
When/if we add other samples to this repo, we can absolutely add GitHub Actions workflows to build and test them. The "primary" build here is src/RGUnityBots
though.
One piece of clarification: This PR introduces no additional samples into this repo. We can absolutely start merging our existing samples into this repo but I haven't done that immediately because each sample needs a little evaluation to ensure we have an appropriate license to redistribute it since this is a public repo. Our samples are almost entirely from "open-source" content and our own original work, so this should be straightforward, but I didn't want to jump straight in to that right now.
This is largely my plan, though I'm saving it for future PRs. I think the We also have the option, in this layout, of creating samples that live outside the SDK package itself, in the
The Unity SDK package is now in
In either case, only the SDK ( |
Yep, that's what I'm working on now. |
Sample Update PRs (I'll be editing this in-place as they are opened):
|
@analogrelay ah yes I guess my concern was the following - I thought the point of this PR was to begin supporting putting our samples into this repo, which sounds like the next steps. However, I am more worried now about the idea that if we do start adding samples, then when a user goes to add our package, even though our SDK folder would be small, they would need to pull gigabytes worth of sample projects that then get thrown away by Unity anyways. That was what I was getting at with my comment, if that makes sense! |
I don't believe that's the case. The point of the PR is to be able to build and test the SDK. The fact that we can put samples in here is a bonus, but it's entirely an entirely separate decision IMO. |
Ah got it - makes more sense now! Thanks! |
I opened PRs against all our samples, but I want to merge this and my other outstanding PRs first, then update those PRs. For a few reasons:
So, the plan for now is to merge this, then update my other PRs to resolve conflicts (since trying to resolve conflicts here would be a lot). |
Warning
When this PR merges, all references to our SDK will have to be updated.
This applies to:
main
0.0.16
(next release) on.In addition, we need to update our README when we ship
0.0.16
to provide the correct Git URL.Note
There's a lot here. I recommend reviewing it commit-by-commit, as it's easier to follow. Use the dropdown in the top-left of the PR review panel:
The first commit moves the existing package in to
src/gg.regression.unity.bots
and the second commit adds theRGUnityBots
project. From there, I'll be adding additional scripts for CI/CD.This PR refactors our repo so that it has our package, and a "Host" Unity project:
src/gg.regression.unity.bots
- The RegressionGames Unity SDK package.src/RGUnityBots
- A barebones 3D Unity game that is used to build and test the Unity SDK package.The
RGUnityBots
Unity project referencesgg.regression.unity.bots
via a relative path, so if you build it or run tests, it can validate the Unity SDK itself.Compilation errors are rendered in the PR files list!
Test results render in the "Details" view for the "Unity Build and Test / Test Results" PR Check:
TODO:
Blocked by:
Find the pull request instructions here
Every reviewer and the owner of the PR should consider these points in their request (feel free to copy this checklist so you can fill it out yourself in the overall PR comment)