-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start running Unity tests on CI (#2963)
Co-authored-by: Bernd Wachter <[email protected]>
- Loading branch information
Showing
22 changed files
with
357 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 @@ | ||
#@ load("@ytt:template", "template") | ||
#@ load("common.lib.yml", "uploadArtifacts", "actionDownloadArtifact", "checkoutCode") | ||
#@ load("test.lib.yml", "publishTestsResults") | ||
|
||
#@ unityPkgName = "io.realm.unity-${{ inputs.version }}.tgz" | ||
|
||
--- | ||
name: test-unity | ||
"on": | ||
workflow_call: | ||
inputs: | ||
version: | ||
type: string | ||
required: true | ||
platform: | ||
type: string | ||
required: true | ||
settings: | ||
type: string | ||
required: true | ||
env: | ||
REALM_DISABLE_ANALYTICS: true | ||
DOTNET_NOLOGO: true | ||
jobs: | ||
build-tests: | ||
runs-on: | ||
- unity | ||
- ${{ matrix.platform.os }} | ||
name: Build Unity ${{ matrix.platform.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: ${{ fromJson(inputs.platform) }} | ||
settings: ${{ fromJson(inputs.settings) }} | ||
timeout-minutes: 30 | ||
steps: | ||
- #@ template.replace(checkoutCode()) | ||
- name: Cleanup Workspace | ||
run: git clean -fdx | ||
- name: Fetch Unity Package | ||
uses: #@ actionDownloadArtifact | ||
with: | ||
name: #@ unityPkgName | ||
path: Realm/Realm.Unity | ||
- name: Fetch Unity Tests | ||
uses: #@ actionDownloadArtifact | ||
with: | ||
name: UnityTests | ||
path: Tests/Tests.Unity | ||
- name: Build Unity Tests | ||
run: | | ||
unity-editor -runTests -batchmode -projectPath ${{ github.workspace }}/Tests/Tests.Unity -testPlatform Standalone${{ matrix.platform.testPlatform }} -testSettingsFile ${{ github.workspace }}/Tests/Tests.Unity/.TestConfigs/${{ matrix.settings }}.json -logFile ${{ matrix.platform.os == 'windows' && 'build.log' || '-'}} | ||
- #@ uploadArtifacts("UnityTestsRunner.${{ matrix.platform.os }}", "Tests/Tests.Unity/Player_Standalone${{ matrix.platform.testPlatform }}_${{ matrix.settings }}/") | ||
|
||
run-tests-linux: | ||
runs-on: ubuntu-latest | ||
name: Unity Linux | ||
timeout-minutes: 30 | ||
needs: | ||
- build-tests | ||
if: ${{ contains(inputs.platform, 'Linux') }} | ||
steps: | ||
- #@ template.replace(checkoutCode()) | ||
- name: Download Test Runner | ||
uses: #@ actionDownloadArtifact | ||
with: | ||
name: UnityTestsRunner.linux | ||
path: TestRunner | ||
- name: Install xvfb | ||
run: sudo apt install -y xvfb libglu1 libxcursor1 | ||
- name: Run Tests | ||
run: | | ||
chmod +x ${{ github.workspace }}/TestRunner/PlayerWithTests.x86_64 | ||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' ${{ github.workspace }}/TestRunner/PlayerWithTests.x86_64 -logFile - --result=${{ github.workspace }}/TestResults.xml | ||
- #@ publishTestsResults("TestResults.xml", "Unity Linux Mono_Net4") | ||
|
||
run-tests-windows: | ||
runs-on: windows-latest | ||
name: Unity Windows | ||
if: ${{ contains(inputs.platform, 'Windows') }} | ||
timeout-minutes: 30 | ||
needs: | ||
- build-tests | ||
steps: | ||
- #@ template.replace(checkoutCode()) | ||
- name: Download Test Runner | ||
uses: #@ actionDownloadArtifact | ||
with: | ||
name: UnityTestsRunner.windows | ||
path: TestRunner | ||
- name: Run Tests | ||
run: | | ||
Start-Process ${{ github.workspace }}\TestRunner\PlayerWithTests.exe -Wait -ArgumentList "-logFile","${{ github.workspace }}\test.log","--result=${{ github.workspace }}\TestResults.xml" | ||
cat ${{ github.workspace }}\test.log | ||
shell: powershell | ||
- #@ publishTestsResults("TestResults.xml", "Unity Windows Mono_Net4") |
This file contains 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 |
---|---|---|
|
@@ -128,10 +128,6 @@ jobs: | |
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ runner.os == 'Windows' }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('Realm/Realm.Fody/*.csproj', 'Realm/Realm/*.csproj', 'Realm/Realm.UnityUtils/*.csproj', 'Realm/Realm.UnityWeaver/*.csproj') }} | ||
- name: Build Realm/Realm.Fody | ||
run: msbuild Realm/Realm.Fody -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} | ||
- name: Build Realm/Realm | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -56,10 +56,6 @@ jobs: | |
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ runner.os == 'Windows' }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('Tests/Tests.Android/*.csproj') }} | ||
- name: Build Tests/Tests.Android | ||
run: msbuild Tests/Tests.Android -t:SignAndroidPackage -p:Configuration=Release -restore -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:AndroidSupportedAbis=armeabi-v7a -p:AndroidUseSharedRuntime=False -p:EmbedAssembliesIntoApk=True | ||
- name: Configure AWS Credentials | ||
|
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -48,10 +48,6 @@ jobs: | |
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ runner.os == 'Windows' }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('Tests/Tests.iOS/*.csproj') }} | ||
- name: Build Tests/Tests.iOS | ||
run: msbuild Tests/Tests.iOS -p:Configuration=Release -restore -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:Platform=iPhoneSimulator | ||
- name: Run the tests | ||
|
This file contains 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 |
---|---|---|
|
@@ -48,10 +48,6 @@ jobs: | |
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ runner.os == 'Windows' }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('Tests/Tests.XamarinMac/*.csproj') }} | ||
- name: Build Tests/Tests.XamarinMac | ||
run: msbuild Tests/Tests.XamarinMac -p:Configuration=Release -restore -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} | ||
- name: Run the tests | ||
|
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -48,10 +48,6 @@ jobs: | |
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ runner.os == 'Windows' }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('Tests/Realm.Tests/*.csproj') }} | ||
- name: Build Tests/Realm.Tests | ||
run: msbuild Tests/Realm.Tests -p:Configuration=Release -restore -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:TargetFramework=net461 -p:RealmTestsStandaloneExe=true | ||
- name: Run the tests | ||
|
Oops, something went wrong.