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

Build in linux docker, test on supported platforms #563

Merged
merged 14 commits into from
Feb 17, 2022
Merged

Conversation

vaind
Copy link
Collaborator

@vaind vaind commented Feb 15, 2022

See #449

Uses a linux+docker based Unity to prepare "build projects" for all platforms and then runs the actual build on the target platforms

#skip-changelog

@vaind vaind force-pushed the chore/build-in-docker branch 11 times, most recently from fe339cf to 3482444 Compare February 16, 2022 09:53
@vaind vaind force-pushed the chore/build-in-docker branch from a26d4c8 to 028eec3 Compare February 16, 2022 12:12
@vaind vaind force-pushed the chore/build-in-docker branch from 028eec3 to 0b9e288 Compare February 16, 2022 13:00
@vaind vaind force-pushed the chore/build-in-docker branch from 8d0611c to f30e01f Compare February 16, 2022 13:37
@vaind vaind force-pushed the chore/build-in-docker branch from 8edeed5 to 67a7c89 Compare February 16, 2022 21:54
Copy link
Collaborator Author

@vaind vaind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some info for a future reviewer

with:
path: samples/artifacts/builds
# using hash of package.json to bust cache on release builds which modify it
key: samples/artifacts/builds|${{ matrix.os }}-${{ matrix.unity-version }}-${{ matrix.unity-version-changeset }}-${{ hashFiles('package/package.json') }}
Copy link
Collaborator Author

@vaind vaind Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was caching the android (smoke-test) player build but that doesn't make sense (with the key based only on the package.json) - we actually weren't testing the code changes made in the PRs if the cache key hit...

key: samples/unity-of-bugs/Library|${{ matrix.os }}-${{ matrix.unity-version }}-${{ matrix.unity-version-changeset }}-${{ hashFiles('samples/unity-of-bugs/Packages/packages-lock.json') }}
path: |
samples/unity-of-bugs/Library/Packages
temp/unity-packages/Library/ScriptAssemblies/*.TestRunner.*
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestRunner wasn't cached - caching it speeds up (skips) UnityRestorePackages target

Comment on lines -255 to -274
- name: Integration Test - Create new Project
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-create-project.ps1 "${{ env.UNITY_PATH }}"

- name: Integration Test - Build Standalone Player without Sentry SDK
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-build-project.ps1 "${{ env.UNITY_PATH }}"

- name: Integration Test - Add Sentry to test project
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-update-sentry.ps1 "${{ env.UNITY_PATH }}"

- name: Integration Test - Build Standalone Player Sentry SDK
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-build-project.ps1 "${{ env.UNITY_PATH }}"

- name: Integration Test - Run Player - Smoke Test
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-run-smoke-test.ps1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to a separate windows-smoke-test job below

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a Mac and Linux too for standalone. Less relevant until we have native support

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, seemed a bit pointless to run on those while they're not officially supported yet. Would just take away from the available github-actions runners' pool. So if you don't mind I'd also add them later when needed.

Comment on lines +253 to +258
- name: Setup Unity
uses: getsentry/setup-unity@46c2e082d98cc3a825a5b59038cb31705fe9ff56
with:
unity-version: ${{ matrix.unity-version }}
unity-version-changeset: ${{ matrix.unity-version-changeset }}
unity-modules: windows-il2cpp
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows runners can't use containers because of licensing & the limitations of Windows Server 2022 (no support for WSL2), see actions/runner#904

Therefore we stay with the standard unity setup here

@@ -60,6 +60,7 @@ public static void BuildIl2CPPPlayer(BuildTarget buildTarget)

public static void BuildWindowsIl2CPPPlayer() => BuildIl2CPPPlayer(BuildTarget.StandaloneWindows64);
public static void BuildMacIl2CPPPlayer() => BuildIl2CPPPlayer(BuildTarget.StandaloneOSX);
public static void BuildLinuxIl2CPPPlayer() => BuildIl2CPPPlayer(BuildTarget.StandaloneLinux64);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ended up unused but I guess we can keep it for now. Later we can fix the smoke test on linux (currently times out)

@vaind vaind marked this pull request as ready for review February 17, 2022 08:58
@vaind vaind requested a review from bitsandfoxes as a code owner February 17, 2022 08:58
@@ -228,19 +146,14 @@ jobs:
- name: Configure Sentry via the Editor Window
run: dotnet msbuild /t:UnityConfigureSentryOptions /p:Configuration=Release /p:OutDir=other src/Sentry.Unity

# TODO: can we make unity only prepare the project, without compiling it, to unlock the unity license faster? iOS is already built like that.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please. Export gradle project.

Downside is that we don't cover some code path the one that uploads symbols when unity builds an apk. But we anyway have 2 paths to test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do the other (=current) path later in another job later on. In any case I'd do this change in a followup PR.

Comment on lines -255 to -274
- name: Integration Test - Create new Project
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-create-project.ps1 "${{ env.UNITY_PATH }}"

- name: Integration Test - Build Standalone Player without Sentry SDK
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-build-project.ps1 "${{ env.UNITY_PATH }}"

- name: Integration Test - Add Sentry to test project
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-update-sentry.ps1 "${{ env.UNITY_PATH }}"

- name: Integration Test - Build Standalone Player Sentry SDK
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-build-project.ps1 "${{ env.UNITY_PATH }}"

- name: Integration Test - Run Player - Smoke Test
shell: pwsh
run: ./test/Scripts.Integration.Test/integration-run-smoke-test.ps1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a Mac and Linux too for standalone. Less relevant until we have native support

@vaind vaind force-pushed the chore/build-in-docker branch from e62ff2c to 7139691 Compare February 17, 2022 10:13
@vaind vaind merged commit 964ae20 into main Feb 17, 2022
@vaind vaind deleted the chore/build-in-docker branch February 17, 2022 18:21
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.

2 participants