-
-
Notifications
You must be signed in to change notification settings - Fork 62
chore: update setup-unity and run macOS e2e tests
#2673
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
base: main
Are you sure you want to change the base?
Changes from all commits
dfcc4a3
a151043
60f16df
89c9a5b
964c006
977760a
ee9ab8d
ca719ee
659f61a
9c3110c
613093f
9b8511b
0da2438
a159fbb
acbea17
75e050e
a4318f3
e605040
7d7a535
0643401
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| name: "Test: Build macOS" | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| unity-version: | ||
| required: true | ||
| type: string | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: pwsh | ||
|
|
||
| jobs: | ||
| build: | ||
| name: macOS ${{ inputs.unity-version }} | ||
| runs-on: macos-latest | ||
| env: | ||
| UNITY_VERSION: ${{ inputs.unity-version }} | ||
| BUILD_PLATFORM: MacOS | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Load env | ||
| id: env | ||
| run: | | ||
| $u = (Get-Content scripts/unity-versions.json -Raw | ConvertFrom-Json).'${{ env.UNITY_VERSION }}' | ||
| "unityVersion=$($u.version)" >> $env:GITHUB_OUTPUT | ||
| "unityChangeset=$($u.changeset)" >> $env:GITHUB_OUTPUT | ||
|
|
||
| - name: Setup Unity | ||
| uses: getsentry/setup-unity@1bbd385ae3b0505069aacc56d47f0a16366f10b1 | ||
| with: | ||
| unity-version: ${{ steps.env.outputs.unityVersion }} | ||
| unity-version-changeset: ${{ steps.env.outputs.unityChangeset }} | ||
| unity-modules: mac-il2cpp | ||
|
|
||
| - name: Create Unity license config | ||
| run: | | ||
| sudo mkdir -p "/Library/Application Support/Unity/config" | ||
| echo "$env:UNITY_LICENSE_SERVER_CONFIG" | sudo tee "/Library/Application Support/Unity/config/services-config.json" > /dev/null | ||
| env: | ||
| UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }} | ||
|
|
||
| - name: Download IntegrationTest project | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: test-${{ env.UNITY_VERSION }} | ||
|
|
||
| - name: Extract project archive | ||
| run: tar -xvzf test-project.tar.gz | ||
|
|
||
| - name: Cache Unity Library | ||
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: samples/IntegrationTest/Library | ||
| key: Library-IntegrationTest-macos-${{ env.UNITY_VERSION }}-v1 | ||
| restore-keys: | | ||
| Library-IntegrationTest-macos-${{ env.UNITY_VERSION }}- | ||
| Library-IntegrationTest-macos- | ||
|
|
||
| - name: Restore cached build without Sentry | ||
| id: cache-build-nosentry | ||
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: samples/IntegrationTest/Build-NoSentry | ||
| key: build-nosentry-MacOS-${{ inputs.unity-version }} | ||
|
|
||
| - name: Build without Sentry SDK | ||
| if: steps.cache-build-nosentry.outputs.cache-hit != 'true' | ||
| run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform MacOS -BuildDirName "Build-NoSentry" | ||
|
|
||
| - name: Download UPM package | ||
| uses: ./.github/actions/wait-for-artifact | ||
| with: | ||
| name: package-release | ||
|
|
||
| - name: Extract UPM package | ||
| run: ./test/Scripts.Integration.Test/extract-package.ps1 | ||
|
|
||
| - name: Add Sentry to the project | ||
| run: ./test/Scripts.Integration.Test/add-sentry.ps1 -UnityPath "$env:UNITY_PATH" -PackagePath "test-package-release" | ||
|
|
||
| - name: Configure Sentry | ||
| run: ./test/Scripts.Integration.Test/configure-sentry.ps1 -UnityPath "$env:UNITY_PATH" -Platform MacOS | ||
| env: | ||
| SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }} | ||
|
|
||
| - name: Build with Sentry SDK | ||
| run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform MacOS -UnityVersion "$env:UNITY_VERSION" | ||
|
|
||
| - name: Compare build sizes | ||
| run: ./test/Scripts.Integration.Test/measure-build-size.ps1 -Path1 "samples/IntegrationTest/Build-NoSentry" -Path2 "samples/IntegrationTest/Build" -Platform MacOS -UnityVersion "$env:UNITY_VERSION" | ||
|
|
||
| - name: Upload build size measurement | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: build-size-MacOS-${{ env.UNITY_VERSION }} | ||
| path: build-size-measurements/*.json | ||
| retention-days: 1 | ||
|
|
||
| # We create tar explicitly because upload-artifact is slow for many files. | ||
| - name: Create archive | ||
| run: | | ||
| Remove-Item -Recurse -Force samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame -ErrorAction SilentlyContinue | ||
| tar -cvzf test-app-desktop.tar.gz samples/IntegrationTest/Build | ||
|
|
||
| - name: Upload test app | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: testapp-desktop-compiled-${{ env.UNITY_VERSION }}-macos | ||
| if-no-files-found: error | ||
| path: test-app-desktop.tar.gz | ||
| retention-days: 14 | ||
|
|
||
| - name: Upload IntegrationTest project on failure | ||
| if: ${{ failure() }} | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: failed-project-desktop-macos-${{ env.UNITY_VERSION }} | ||
| path: | | ||
| samples/IntegrationTest | ||
| unity.log | ||
| !samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame | ||
| retention-days: 14 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,12 +24,16 @@ jobs: | |
|
|
||
| - name: Load env | ||
| id: env | ||
| run: echo "unityVersion=$(./scripts/ci-env.ps1 "unity$env:UNITY_VERSION")" >> $env:GITHUB_OUTPUT | ||
| run: | | ||
| $u = (Get-Content scripts/unity-versions.json -Raw | ConvertFrom-Json).'${{ env.UNITY_VERSION }}' | ||
| "unityVersion=$($u.version)" >> $env:GITHUB_OUTPUT | ||
| "unityChangeset=$($u.changeset)" >> $env:GITHUB_OUTPUT | ||
|
|
||
| - name: Setup Unity | ||
| uses: getsentry/setup-unity@3bdc8c022b6d30ecf2d21d12a564bfa55a54fa2e | ||
| uses: getsentry/setup-unity@1bbd385ae3b0505069aacc56d47f0a16366f10b1 | ||
| with: | ||
| unity-version: ${{ steps.env.outputs.unityVersion }} | ||
| unity-version-changeset: ${{ steps.env.outputs.unityChangeset }} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. providing it instead of trying some magic to find it. |
||
| unity-modules: windows-il2cpp | ||
|
|
||
| - name: Create Unity license config | ||
|
|
||
This file was deleted.
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using this to hold the unity version data. we provide the changeset now from here instead, so we don't need to rely on some brittle magic to figure out downloading those versions in the |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "2021.3": { | ||
| "version": "2021.3.45f2", | ||
| "changeset": "88f88f591b2e" | ||
| }, | ||
| "2022.3": { | ||
| "version": "2022.3.62f3", | ||
| "changeset": "96770f904ca7" | ||
| }, | ||
| "6000.0": { | ||
| "version": "6000.0.74f1", | ||
| "changeset": "7685f01dc6be" | ||
| }, | ||
| "6000.3": { | ||
| "version": "6000.3.14f1", | ||
| "changeset": "d68c3f99a318" | ||
| } | ||
| } |
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.
macos e2e tests are back!