-
Notifications
You must be signed in to change notification settings - Fork 0
Shenanigans #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
Open
vecipher
wants to merge
11
commits into
main
Choose a base branch
from
shenanigans
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Shenanigans #3
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
043ab5e
Initial Unity Project
MintySlug 9fe7940
Removed Unnecessary things
MintySlug 84b06b3
.gitignore setup by Tom
vecipher 775efd9
placeholder ci
vecipher 043693c
minor fix
vecipher cae5281
a very minor naming change
vecipher 5f3c4b6
please work
vecipher d84f545
Merge branch 'Initial-Unity-commit' into TomGitignore
vecipher c4a697c
Merge pull request #1 from vecipher/TomGitignore
vecipher 7189f28
winows to mac and vice versa test
MintySlug a2be1c1
ci integration of ollie's "tests" - needs .ulf license
vecipher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,184 @@ | ||
| name: ci.yml | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| UNITY_VERSION: 6000.2.9f1 | ||
| UNITY_CHANGESET: e0c4e791ab71 | ||
|
|
||
| jobs: | ||
| playmode-tests: | ||
| name: PlayMode Tests (${{ matrix.os }}) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
|
||
| steps: | ||
| - name: Checkout project | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| lfs: true | ||
|
|
||
| - name: Cache Library | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: Library | ||
| key: Library-${{ runner.os }}-${{ env.UNITY_VERSION }}-${{ hashFiles('Packages/manifest.json') }} | ||
| restore-keys: | | ||
| Library-${{ runner.os }}-${{ env.UNITY_VERSION }}- | ||
| Library-${{ runner.os }}- | ||
|
|
||
| - name: Configure Unity license (Linux) | ||
| if: runner.os == 'Linux' | ||
| shell: bash | ||
| env: | ||
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} # generate .ulf from any machine where you’ve activated Unity Personal (Hub -> Manage License -> “Manual activation” -> save the license file)” and upload the response Unity emails back. Once you have the .ulf, add UNITY_LICENSE to your repo’s secrets with its base64 text; the workflow will then decode it and tests will run on all three OS runners. | ||
| run: | | ||
| python3 -c "import base64, os, sys, pathlib; data=os.environ.get('UNITY_LICENSE'); \ | ||
| if not data: sys.stderr.write('UNITY_LICENSE secret is required to run Unity in CI.\n'); sys.exit(1); \ | ||
| target = pathlib.Path.home() / '.local/share/unity3d/Unity/Unity_lic.ulf'; \ | ||
| target.parent.mkdir(parents=True, exist_ok=True); \ | ||
| target.write_bytes(base64.b64decode(data)); \ | ||
| print(f'Wrote Unity license to {target}')" | ||
| echo "UNITY_LICENSE_FILE=$HOME/.local/share/unity3d/Unity/Unity_lic.ulf" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Configure Unity license (macOS) | ||
| if: runner.os == 'macOS' | ||
| shell: bash | ||
| env: | ||
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
| run: | | ||
| python3 -c "import base64, os, sys, pathlib; data=os.environ.get('UNITY_LICENSE'); \ | ||
| if not data: sys.stderr.write('UNITY_LICENSE secret is required to run Unity in CI.\n'); sys.exit(1); \ | ||
| target = pathlib.Path.home() / 'Library/Application Support/Unity/Unity_lic.ulf'; \ | ||
| target.parent.mkdir(parents=True, exist_ok=True); \ | ||
| target.write_bytes(base64.b64decode(data)); \ | ||
| print(f'Wrote Unity license to {target}')" | ||
| echo "UNITY_LICENSE_FILE=$HOME/Library/Application Support/Unity/Unity_lic.ulf" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Configure Unity license (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| env: | ||
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
| run: | | ||
| if (-not $env:UNITY_LICENSE) { | ||
| Write-Error "UNITY_LICENSE secret is required to run Unity in CI." -ErrorAction Stop | ||
| } | ||
| $licenseDir = Join-Path $env:LOCALAPPDATA 'Unity' | ||
| New-Item -ItemType Directory -Path $licenseDir -Force | Out-Null | ||
| $licensePath = Join-Path $licenseDir 'Unity_lic.ulf' | ||
| [System.IO.File]::WriteAllBytes($licensePath, [System.Convert]::FromBase64String($env:UNITY_LICENSE)) | ||
| Add-Content -Path $env:GITHUB_ENV -Value "UNITY_LICENSE_FILE=$licensePath" | ||
|
|
||
| - name: Install Unity dependencies (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends \ | ||
| libgtk2.0-0 \ | ||
| libgtk-3-0 \ | ||
| libglib2.0-0 \ | ||
| libasound2 \ | ||
| libxcomposite1 \ | ||
| libxcursor1 \ | ||
| libxdamage1 \ | ||
| libxrandr2 \ | ||
| libxfixes3 \ | ||
| libxtst6 \ | ||
| libxi6 \ | ||
| libnss3 \ | ||
| libglu1-mesa \ | ||
| xvfb | ||
|
|
||
| - name: Install Unity editor (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| curl -L "https://download.unity3d.com/download_unity/${UNITY_CHANGESET}/Unity.tar.xz" -o Unity.tar.xz | ||
| sudo mkdir -p /opt/unity | ||
| sudo tar -xJf Unity.tar.xz -C /opt/unity | ||
| sudo chmod +x /opt/unity/Editor/Unity | ||
| echo "UNITY_EDITOR_PATH=/opt/unity/Editor/Unity" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Install Unity editor (macOS) | ||
| if: runner.os == 'macOS' | ||
| run: | | ||
| curl -L "https://download.unity3d.com/download_unity/${UNITY_CHANGESET}/MacEditorInstaller/Unity.pkg" -o Unity.pkg | ||
| sudo installer -pkg Unity.pkg -target / | ||
| UNITY_APP="/Applications/Unity/Unity.app/Contents/MacOS/Unity" | ||
| if [ ! -f "$UNITY_APP" ]; then | ||
| echo "::error::Unity editor not found at $UNITY_APP" | ||
| exit 1 | ||
| fi | ||
| echo "UNITY_EDITOR_PATH=$UNITY_APP" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Install Unity editor (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| $installer = Join-Path $env:TEMP "UnitySetup-${{ env.UNITY_VERSION }}.exe" | ||
| Invoke-WebRequest "https://download.unity3d.com/download_unity/${{ env.UNITY_CHANGESET }}/Windows64EditorInstaller/UnitySetup64-${{ env.UNITY_VERSION }}.exe" -OutFile $installer | ||
| Start-Process -FilePath $installer -ArgumentList "/S","/D=C:\Program Files\Unity" -Wait | ||
| $unityPath = "C:\Program Files\Unity\Editor\Unity.exe" | ||
| if (-not (Test-Path $unityPath)) { | ||
| throw "Unity editor not found at $unityPath" | ||
| } | ||
| Add-Content -Path $env:GITHUB_ENV -Value "UNITY_EDITOR_PATH=$unityPath" | ||
|
|
||
| - name: Run PlayMode tests (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| xvfb-run --auto-servernum -- \ | ||
| "$UNITY_EDITOR_PATH" \ | ||
| -batchmode \ | ||
| -nographics \ | ||
| -quit \ | ||
| -projectPath "$GITHUB_WORKSPACE" \ | ||
| -runTests \ | ||
| -testPlatform PlayMode \ | ||
| -testResults "$GITHUB_WORKSPACE/TestResults-${{ runner.os }}.xml" \ | ||
| -logFile "$GITHUB_WORKSPACE/Unity-${{ runner.os }}.log" | ||
|
|
||
| - name: Run PlayMode tests (macOS) | ||
| if: runner.os == 'macOS' | ||
| run: | | ||
| "$UNITY_EDITOR_PATH" \ | ||
| -batchmode \ | ||
| -nographics \ | ||
| -quit \ | ||
| -projectPath "$GITHUB_WORKSPACE" \ | ||
| -runTests \ | ||
| -testPlatform PlayMode \ | ||
| -testResults "$GITHUB_WORKSPACE/TestResults-${{ runner.os }}.xml" \ | ||
| -logFile "$GITHUB_WORKSPACE/Unity-${{ runner.os }}.log" | ||
|
|
||
| - name: Run PlayMode tests (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| & "$env:UNITY_EDITOR_PATH" ` | ||
| -batchmode ` | ||
| -nographics ` | ||
| -quit ` | ||
| -projectPath "$env:GITHUB_WORKSPACE" ` | ||
| -runTests ` | ||
| -testPlatform PlayMode ` | ||
| -testResults "$env:GITHUB_WORKSPACE\TestResults-${{ runner.os }}.xml" ` | ||
| -logFile "$env:GITHUB_WORKSPACE\Unity-${{ runner.os }}.log" | ||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "Unity exited with code $LASTEXITCODE" | ||
| } | ||
|
|
||
| - name: Upload test artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: unity-playmode-${{ runner.os }} | ||
| path: | | ||
| TestResults-${{ runner.os }}.xml | ||
| Unity-${{ runner.os }}.log | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
|
|
||
| # This .gitignore file should be placed at the root of your Unity project directory | ||
| # | ||
| # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore | ||
| # | ||
| /[Ll]ibrary/ | ||
| /[Tt]emp/ | ||
| /[Oo]bj/ | ||
| /[Bb]uild/ | ||
| /[Bb]uilds/ | ||
| /[Ll]ogs/ | ||
| /[Uu]ser[Ss]ettings/ | ||
|
|
||
| # MemoryCaptures can get excessive in size. | ||
| # They also could contain extremely sensitive data | ||
| /[Mm]emoryCaptures/ | ||
|
|
||
| # Asset meta data should only be ignored when the corresponding asset is also ignored | ||
| !/[Aa]ssets/**/*.meta | ||
|
|
||
| # Recordings can get excessive in size | ||
| /[Rr]ecordings/ | ||
|
|
||
|
|
||
| # Uncomment this line if you wish to ignore the asset store tools plugin | ||
| # /[Aa]ssets/AssetStoreTools* | ||
|
|
||
| # Autogenerated Jetbrains Rider plugin | ||
| [Aa]ssets/Plugins/Editor/JetBrains* | ||
|
|
||
| # Visual Studio cache directory | ||
| .vs/ | ||
|
|
||
| # Gradle cache directory | ||
| .gradle/ | ||
|
|
||
| # Autogenerated VS/MD/Consulo solution and project files | ||
| ExportedObj/ | ||
| .consulo/ | ||
| *.csproj | ||
| *.unityproj | ||
| *.sln | ||
| *.suo | ||
| *.tmp | ||
| *.user | ||
| *.userprefs | ||
| *.pidb | ||
| *.booproj | ||
| *.svd | ||
| *.pdb | ||
| *.mdb | ||
| *.opendb | ||
| *.VC.db | ||
|
|
||
| # Unity3D generated meta files | ||
| *.pidb.meta | ||
| *.pdb.meta | ||
| *.mdb.meta | ||
|
|
||
| # Unity3D generated file on crash reports | ||
| sysinfo.txt | ||
|
|
||
| # Builds | ||
| *.apk | ||
| *.unitypackage | ||
| *.aab | ||
| *.app | ||
|
|
||
| # Crashlytics generated file | ||
| crashlytics-build.properties | ||
|
|
||
| # macOS Specific | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| ehthumbs.db | ||
| Thumbs.db | ||
| report.xml | ||
| Thumbs.db.meta | ||
|
|
||
| # JetBrains | ||
| /.idea/ | ||
| .idea/** | ||
|
|
||
| # Asset Hunter build info | ||
| *.ahbuildinfo | ||
|
|
||
| # FMOD | ||
| fmod.log | ||
| fmod_editor.log | ||
| /Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset | ||
| /Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset.meta | ||
|
|
||
| /Assets/Plugins/FMOD/Cache/Editor.meta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "version": "1.0", | ||
| "components": [ | ||
| "Microsoft.VisualStudio.Workload.ManagedGame" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| %YAML 1.1 | ||
| %TAG !u! tag:unity3d.com,2011: | ||
| --- !u!114 &11400000 | ||
| MonoBehaviour: | ||
| m_ObjectHideFlags: 0 | ||
| m_CorrespondingSourceObject: {fileID: 0} | ||
| m_PrefabInstance: {fileID: 0} | ||
| m_PrefabAsset: {fileID: 0} | ||
| m_GameObject: {fileID: 0} | ||
| m_Enabled: 1 | ||
| m_EditorHideFlags: 0 | ||
| m_Script: {fileID: 11500000, guid: fcf7219bab7fe46a1ad266029b2fee19, type: 3} | ||
| m_Name: Readme | ||
| m_EditorClassIdentifier: | ||
| icon: {fileID: 2800000, guid: d19680cd422524695938fbe55cc3b3bd, type: 3} | ||
| title: HDRP Empty Template | ||
| sections: | ||
| - heading: Welcome to the HDRP Empty Template | ||
| text: This template includes the settings and assets you need to start creating | ||
| with HDRP. | ||
| linkText: | ||
| url: | ||
| - heading: Documentation | ||
| text: | ||
| linkText: Read more about the HDRP | ||
| url: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html | ||
| - heading: Samples | ||
| text: | ||
| linkText: Samples and content you can use in your project | ||
| url: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/HDRP-Sample-Content.html | ||
| - heading: Forums | ||
| text: | ||
| linkText: Get answers and support | ||
| url: https://forum.unity.com/forums/high-definition-render-pipeline.386/ | ||
| - heading: Bugs | ||
| text: | ||
| linkText: Report any bugs | ||
| url: https://unity3d.com/unity/qa/bug-reporting | ||
| loadedLayout: 1 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The workflow unconditionally requires
secrets.UNITY_LICENSEand exits with an error when it is absent. GitHub does not expose repository secrets topull_requestworkflows triggered from forks, so any external contributor PR will fail before tests even run. Consider guarding the license configuration and test steps behind a check for a present secret or skipping the entire job when the event originates from a fork to keep CI usable for outside contributions.Useful? React with 👍 / 👎.