mirror of
https://github.com/game-ci/unity-test-runner.git
synced 2026-01-29 22:49:12 +08:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d0bc623a7 | ||
|
|
6ed138a47c | ||
|
|
7787abf249 | ||
|
|
31086d9859 | ||
|
|
cfa9076acb | ||
|
|
d982116b88 | ||
|
|
b9980d6db7 | ||
|
|
34809a534f | ||
|
|
677bd599b0 | ||
|
|
be0f55d3cf | ||
|
|
42c28a953e | ||
|
|
9fe2feb3c9 | ||
|
|
68d1df1d1b | ||
|
|
698c08cf4e | ||
|
|
5263cf0ab1 | ||
|
|
3bffd88e03 | ||
|
|
45ec546c43 | ||
|
|
26c9b7abe1 | ||
|
|
811160c5b3 | ||
|
|
3d5d2f5834 | ||
|
|
e8774f3837 |
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@@ -1,8 +1,8 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
github: game-ci
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: game-ci
|
||||
open_collective: # replace with a single OpenCollective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
|
||||
348
.github/workflows/main.yml
vendored
348
.github/workflows/main.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 12.x
|
||||
node-version: 18.x
|
||||
- run: yarn
|
||||
- run: yarn lint
|
||||
- run: yarn test
|
||||
@@ -32,10 +32,11 @@ jobs:
|
||||
projectPath:
|
||||
- unity-project-with-correct-tests
|
||||
unityVersion:
|
||||
- 2019.2.11f1
|
||||
- 2022.3.7f1
|
||||
testMode:
|
||||
- playmode
|
||||
- editmode
|
||||
- standalone
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
@@ -77,7 +78,7 @@ jobs:
|
||||
projectPath:
|
||||
- unity-project-with-correct-tests
|
||||
unityVersion:
|
||||
- 2019.2.11f1
|
||||
- 2022.3.7f1
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
@@ -105,7 +106,7 @@ jobs:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: all
|
||||
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+MyScripts'
|
||||
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+MyScripts;dontClear'
|
||||
# Test implicit artifactsPath, by not setting it
|
||||
|
||||
# Upload artifacts
|
||||
@@ -131,7 +132,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
unityVersion:
|
||||
- 2019.2.11f1
|
||||
- 2022.3.7f1
|
||||
projectPath:
|
||||
- unity-project-with-correct-tests
|
||||
steps:
|
||||
@@ -188,7 +189,7 @@ jobs:
|
||||
projectPath:
|
||||
- unity-project-with-correct-tests
|
||||
unityVersion:
|
||||
- 2019.2.11f1
|
||||
- 2022.3.7f1
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
@@ -234,6 +235,107 @@ jobs:
|
||||
path: ${{ steps.playMode.outputs.coveragePath }}
|
||||
retention-days: 14
|
||||
|
||||
testRunnerInStandalone:
|
||||
name: Test standalone 📺
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
projectPath:
|
||||
- unity-project-with-correct-tests
|
||||
unityVersion:
|
||||
- 2022.3.7f1
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
###########################
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
###########################
|
||||
# Cache #
|
||||
###########################
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ matrix.projectPath }}/Library
|
||||
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
|
||||
restore-keys: |
|
||||
Library-${{ matrix.projectPath }}-
|
||||
Library-
|
||||
|
||||
# Configure test runner
|
||||
- name: Run tests
|
||||
id: standalone
|
||||
uses: ./
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: standalone
|
||||
artifactsPath: artifacts/standalone
|
||||
|
||||
# Upload artifacts
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Test results (play mode)
|
||||
path: ${{ steps.standalone.outputs.artifactsPath }}
|
||||
retention-days: 14
|
||||
|
||||
testRunnerInStandaloneWithIL2CPP:
|
||||
name: Test standalone with IL2CPP 📺
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
projectPath:
|
||||
- unity-project-with-correct-tests
|
||||
unityVersion:
|
||||
- 2022.3.7f1 # Only 2019.4+ docker images contain the IL2CPP backend installed.
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
###########################
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
###########################
|
||||
# Cache #
|
||||
###########################
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ matrix.projectPath }}/Library
|
||||
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
|
||||
restore-keys: |
|
||||
Library-${{ matrix.projectPath }}-
|
||||
Library-
|
||||
|
||||
# Set scripting backend to IL2CPP
|
||||
- name: Rewrite ProjectSettings
|
||||
run: |
|
||||
DefineOriginal=" scriptingBackend: {}"
|
||||
DefineReplace=" scriptingBackend: \\n Standalone: 1"
|
||||
sed -i "{s/$DefineOriginal/$DefineReplace/g}" ${{ matrix.projectPath }}/ProjectSettings/ProjectSettings.asset
|
||||
|
||||
# Configure test runner
|
||||
- name: Run tests
|
||||
id: standalone
|
||||
uses: ./
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: standalone
|
||||
artifactsPath: artifacts/standalone
|
||||
|
||||
# Upload artifacts
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Test results (play mode)
|
||||
path: ${{ steps.standalone.outputs.artifactsPath }}
|
||||
retention-days: 14
|
||||
|
||||
testEachModeSequentially:
|
||||
name: Test each mode sequentially 👩👩👧👦 # don't try this at home (it's much slower)
|
||||
runs-on: ubuntu-latest
|
||||
@@ -241,7 +343,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
unityVersion:
|
||||
- 2019.2.11f1
|
||||
- 2022.3.7f1
|
||||
projectPath:
|
||||
- unity-project-with-correct-tests
|
||||
steps:
|
||||
@@ -281,6 +383,15 @@ jobs:
|
||||
testMode: playmode
|
||||
artifactsPath: artifacts/playmode
|
||||
|
||||
# Configure third test runner
|
||||
- name: Tests in standalone 📺
|
||||
uses: ./
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: standalone
|
||||
artifactsPath: artifacts/playmode
|
||||
|
||||
# Upload combined artifacts
|
||||
- name: Upload combined test results
|
||||
uses: actions/upload-artifact@v3
|
||||
@@ -288,3 +399,226 @@ jobs:
|
||||
name: Test results (combined)
|
||||
path: artifacts/
|
||||
retention-days: 14
|
||||
|
||||
testAllPackageModesLikeInTheReadme:
|
||||
name: Test package mode 📦 in ${{ matrix.testMode }} on version ${{ matrix.unityVersion }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
projectPath:
|
||||
- unity-package-with-correct-tests/com.example.testpackage
|
||||
unityVersion:
|
||||
- 2022.3.7f1
|
||||
testMode:
|
||||
- playmode
|
||||
- editmode
|
||||
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
###########################
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- uses: ./
|
||||
id: packageTests
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: ${{ matrix.testMode }}
|
||||
artifactsPath: ${{ matrix.testMode }}-packageArtifacts
|
||||
customParameters: -profile SomeProfile -someBoolean -someValue exampleValue
|
||||
packageMode: true
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package test results for ${{ matrix.testMode }}
|
||||
path: ${{ steps.packageTests.outputs.artifactsPath }}
|
||||
retention-days: 14
|
||||
|
||||
testPackageRunnerInAllModes:
|
||||
name: Test package mode in all modes 📦✨
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
projectPath:
|
||||
- unity-package-with-correct-tests/com.example.testpackage
|
||||
unityVersion:
|
||||
- 2022.3.7f1
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
###########################
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
# Configure test runner
|
||||
- name: Run tests
|
||||
id: packageAllTests
|
||||
uses: ./
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: all
|
||||
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+example.testpackage.*,-*Tests*'
|
||||
packageMode: true
|
||||
# Test implicit artifactsPath, by not setting it
|
||||
|
||||
# Upload artifacts
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package test results (all)
|
||||
path: ${{ steps.packageAllTests.outputs.artifactsPath }}
|
||||
retention-days: 14
|
||||
|
||||
# Upload coverage
|
||||
- name: Upload coverage results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package Coverage results (all)
|
||||
path: ${{ steps.packageAllTests.outputs.coveragePath }}
|
||||
retention-days: 14
|
||||
|
||||
testPackageRunnerInEditMode:
|
||||
name: Test package mode in edit mode 📦📝
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
unityVersion:
|
||||
- 2022.3.7f1
|
||||
projectPath:
|
||||
- unity-package-with-correct-tests/com.example.testpackage
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
###########################
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
# Configure test runner
|
||||
- name: Run tests
|
||||
id: packageEditMode
|
||||
uses: ./
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: editmode
|
||||
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+example.testpackage.*,-*Tests*'
|
||||
artifactsPath: artifacts/packageeditmode
|
||||
packageMode: true
|
||||
|
||||
# Upload artifacts
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package test results (edit mode)
|
||||
path: ${{ steps.packageEditMode.outputs.artifactsPath }}
|
||||
retention-days: 14
|
||||
|
||||
# Upload coverage
|
||||
- name: Upload coverage results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package Coverage results (edit mode)
|
||||
path: ${{ steps.packageEditMode.outputs.coveragePath }}
|
||||
retention-days: 14
|
||||
|
||||
testPackageRunnerInPlayMode:
|
||||
name: Test package mode in play mode 📦📺
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
projectPath:
|
||||
- unity-package-with-correct-tests/com.example.testpackage
|
||||
unityVersion:
|
||||
- 2022.3.7f1
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
###########################
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
# Configure test runner
|
||||
- name: Run tests
|
||||
id: packagePlayMode
|
||||
uses: ./
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: playmode
|
||||
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+example.testpackage.*,-*Tests*'
|
||||
artifactsPath: artifacts/packageplaymode
|
||||
packageMode: true
|
||||
|
||||
# Upload artifacts
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package test results (play mode)
|
||||
path: ${{ steps.packagePlayMode.outputs.artifactsPath }}
|
||||
retention-days: 14
|
||||
|
||||
# Upload coverage
|
||||
- name: Upload coverage results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package Coverage results (play mode)
|
||||
path: ${{ steps.packagePlayMode.outputs.coveragePath }}
|
||||
retention-days: 14
|
||||
|
||||
testPackageModeEachModeSequentially:
|
||||
name: Test package mode in each mode sequentially 📦 👩👩👧👦 # don't try this at home (it's much slower)
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
unityVersion:
|
||||
- 2022.3.7f1
|
||||
projectPath:
|
||||
- unity-package-with-correct-tests/com.example.testpackage
|
||||
steps:
|
||||
###########################
|
||||
# Checkout #
|
||||
###########################
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
# Configure first test runner
|
||||
- name: Test package mode in editmode 📦📝
|
||||
uses: ./
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: editmode
|
||||
artifactsPath: packageArtifacts/editmode
|
||||
packageMode: true
|
||||
|
||||
# Configure second test runner
|
||||
- name: Test package mode in playmode 📦📺
|
||||
uses: ./
|
||||
with:
|
||||
projectPath: ${{ matrix.projectPath }}
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
testMode: playmode
|
||||
artifactsPath: packageArtifacts/playmode
|
||||
packageMode: true
|
||||
|
||||
# Upload combined artifacts
|
||||
- name: Upload combined test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Package test results (combined)
|
||||
path: packageArtifacts/
|
||||
retention-days: 14
|
||||
|
||||
0
.husky/pre-commit
Normal file → Executable file
0
.husky/pre-commit
Normal file → Executable file
@@ -4,7 +4,7 @@
|
||||
|
||||
GitHub Action to
|
||||
[run tests](https://github.com/marketplace/actions/unity-test-runner)
|
||||
for any Unity project.
|
||||
for any Unity project and _some_ Unity packages.
|
||||
|
||||
Part of the <a href="https://game.ci">GameCI</a> open source project.
|
||||
<br />
|
||||
|
||||
27
action.yml
27
action.yml
@@ -5,14 +5,14 @@ inputs:
|
||||
unityVersion:
|
||||
required: false
|
||||
default: 'auto'
|
||||
description: 'Version of unity to use for testing the project. Use "auto" to get from your ProjectSettings/ProjectVersion.txt'
|
||||
description: 'Version of unity to use for testing the project. Use "auto" to get from your ProjectSettings/ProjectVersion.txt. ⚠️ If testing a Unity Package, this field is required and cannot be set to "auto".'
|
||||
customImage:
|
||||
required: false
|
||||
default: ''
|
||||
description: 'Specific docker image that should be used for testing the project'
|
||||
description: 'Specific docker image that should be used for testing the project. If packageMode is true, this image must have jq installed.'
|
||||
projectPath:
|
||||
required: false
|
||||
description: 'Path to the Unity project to be tested.'
|
||||
description: 'Path to the Unity project or package to be tested.'
|
||||
customParameters:
|
||||
required: false
|
||||
description: 'Extra parameters to configure the Unity editor run.'
|
||||
@@ -22,8 +22,8 @@ inputs:
|
||||
description: 'The type of tests to be run by the test runner.'
|
||||
coverageOptions:
|
||||
required: false
|
||||
default: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport'
|
||||
description: 'Optional coverage parameters for the -coverageOptions argument.'
|
||||
default: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;dontClear'
|
||||
description: 'Optional coverage parameters for the -coverageOptions argument. To get coverage in Package Mode, pass assemblies from the package you want covered to the assemblyFilters option.'
|
||||
artifactsPath:
|
||||
required: false
|
||||
default: 'artifacts'
|
||||
@@ -48,6 +48,18 @@ inputs:
|
||||
required: false
|
||||
default: 'Test Results'
|
||||
description: 'Name for the check run that is created when a github token is provided.'
|
||||
packageMode:
|
||||
required: false
|
||||
default: false
|
||||
description: 'Whether the tests are being run for a Unity package instead of a Unity project. If true, the action can only be run on Linux runners, and any custom docker image passed to this action must have `jq` installed. NOTE: may not work properly for packages with dependencies outside of the Unity Registry.'
|
||||
chownFilesTo:
|
||||
required: false
|
||||
default: ''
|
||||
description: 'User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build artifacts'
|
||||
unityLicensingServer:
|
||||
required: false
|
||||
default: ''
|
||||
description: 'Url to a unity license server for acquiring floating licenses.'
|
||||
outputs:
|
||||
artifactsPath:
|
||||
description: 'Path where the artifacts are stored.'
|
||||
@@ -57,5 +69,6 @@ branding:
|
||||
icon: 'box'
|
||||
color: 'gray-dark'
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'dist/index.js'
|
||||
using: 'node16'
|
||||
main: 'dist/main.js'
|
||||
post: 'dist/post.js'
|
||||
|
||||
48
dist/entrypoint.ps1
vendored
Normal file
48
dist/entrypoint.ps1
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# Create directory for license activation
|
||||
#
|
||||
|
||||
$ACTIVATE_LICENSE_PATH = "${env:GITHUB_WORKSPACE}/_activate-license"
|
||||
New-Item -Path "$ACTIVATE_LICENSE_PATH" -ItemType Directory
|
||||
|
||||
#
|
||||
# Run steps
|
||||
#
|
||||
|
||||
& $PSScriptRoot\steps\activate.ps1
|
||||
& $PSScriptRoot\steps\set_gitcredential.ps1
|
||||
& $PSScriptRoot\steps\run_tests.ps1
|
||||
& $PSScriptRoot\steps\return_license.ps1
|
||||
|
||||
#
|
||||
# Remove license activation directory
|
||||
#
|
||||
|
||||
Remove-Item "$ACTIVATE_LICENSE_PATH" -Recurse -Force
|
||||
|
||||
#
|
||||
# Instructions for debugging
|
||||
#
|
||||
|
||||
if ($TEST_RUNNER_EXIT_CODE -gt 0)
|
||||
{
|
||||
Write-Output ""
|
||||
Write-Output "###########################"
|
||||
Write-Output "# Failure #"
|
||||
Write-Output "###########################"
|
||||
Write-Output ""
|
||||
Write-Output "Please note that the exit code is not very descriptive."
|
||||
Write-Output "Most likely it will not help you solve the issue."
|
||||
Write-Output ""
|
||||
Write-Output "To find the reason for failure: please search for errors in the log above."
|
||||
Write-Output ""
|
||||
}
|
||||
|
||||
#
|
||||
# Exit with code from the build step.
|
||||
#
|
||||
|
||||
if ( ($USE_EXIT_CODE -eq "true") -and ($TEST_RUNNER_EXIT_CODE -ne 2) )
|
||||
{
|
||||
exit $TEST_RUNNER_EXIT_CODE
|
||||
}
|
||||
7859
dist/index.js
generated
vendored
7859
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
13
dist/licenses.txt
generated
vendored
13
dist/licenses.txt
generated
vendored
@@ -686,6 +686,19 @@ Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
uuid
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
webidl-conversions
|
||||
BSD-2-Clause
|
||||
# The BSD 2-Clause License
|
||||
|
||||
1
dist/main.js
vendored
Symbolic link
1
dist/main.js
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
index.js
|
||||
1
dist/post.js
vendored
Symbolic link
1
dist/post.js
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
index.js
|
||||
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
110
dist/steps/activate.ps1
vendored
Normal file
110
dist/steps/activate.ps1
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
# Run in ACTIVATE_LICENSE_PATH directory
|
||||
Write-Output "Changing to $ACTIVATE_LICENSE_PATH directory."
|
||||
Push-Location "$ACTIVATE_LICENSE_PATH"
|
||||
|
||||
if ( ($null -ne ${env:UNITY_LICENSE}) -or ($null -ne ${env:UNITY_LICENSE_FILE}) )
|
||||
{
|
||||
#
|
||||
# PERSONAL LICENSE MODE
|
||||
#
|
||||
# This will activate Unity, using a license file
|
||||
#
|
||||
# Note that this is the ONLY WAY for PERSONAL LICENSES in 2020.
|
||||
# * See for more details: https://gitlab.com/gableroux/unity3d-gitlab-ci-example/issues/5#note_72815478
|
||||
#
|
||||
# The license file can be acquired using `game-ci/request-manual-activation-file` action.
|
||||
Write-Output "Requesting activation (personal license)"
|
||||
|
||||
# Set the license file path
|
||||
$FILE_PATH = "$ACTIVATE_LICENSE_PATH\UnityLicenseFile.ulf"
|
||||
|
||||
if ($null -ne ${env:UNITY_LICENSE})
|
||||
{
|
||||
# Copy license file from Github variables
|
||||
Add-Content -Path $FILE_PATH -Value ${env:UNITY_LICENSE}
|
||||
}
|
||||
elseif ($null -ne ${env:UNITY_LICENSE_FILE})
|
||||
{
|
||||
# Copy license file from file system
|
||||
Add-Content -Path $FILE_PATH -Value ${env:UNITY_LICENSE_FILE}
|
||||
}
|
||||
$convert = (Get-Content -Raw $FILE_PATH) -replace "`r`n","`n"
|
||||
[io.file]::WriteAllText($FILE_PATH, $convert)
|
||||
Get-ChildItem -Path $FILE_PATH
|
||||
|
||||
# Activate license
|
||||
$ACTIVATION_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "C:\Program Files\Unity\Hub\Editor\${env:UNITY_VERSION}\editor\Unity.exe" -ArgumentList "-batchmode -nographics -logFile $ACTIVATE_LICENSE_PATH\activate.log -quit -manualLicenseFile $FILE_PATH"
|
||||
|
||||
# Store the exit code from the verify command
|
||||
$UNITY_EXIT_CODE = $ACTIVATION_OUTPUT.ExitCode
|
||||
|
||||
# The exit code for personal activation is always 1;
|
||||
# Determine whether activation was successful.
|
||||
#
|
||||
# Successful output should include the following:
|
||||
#
|
||||
# "LICENSE SYSTEM [2020120 18:51:20] Next license update check is after 2019-11-25T18:23:38"
|
||||
#
|
||||
$ACTIVATION_SUCCESSFUL = (Get-Content $ACTIVATE_LICENSE_PATH\activate.log | Select-String 'Next license update check is after' | Measure-Object -line | Select-Object -Expand Lines)
|
||||
|
||||
# Set exit code to 0 if activation was successful
|
||||
if ($ACTIVATION_SUCCESSFUL -eq 1)
|
||||
{
|
||||
$UNITY_EXIT_CODE = 0
|
||||
}
|
||||
|
||||
# Remove license file
|
||||
Remove-Item -Force $FILE_PATH
|
||||
}
|
||||
elseif ( ($null -ne ${env:UNITY_SERIAL}) -and ($null -ne ${env:UNITY_EMAIL}) -and ($null -ne ${env:UNITY_PASSWORD}) )
|
||||
{
|
||||
#
|
||||
# PROFESSIONAL (SERIAL) LICENSE MODE
|
||||
#
|
||||
# This will activate unity, using the activating process.
|
||||
#
|
||||
# Note: This is the preferred way for PROFESSIONAL LICENSES.
|
||||
#
|
||||
Write-Output "Requesting activation (professional license)"
|
||||
|
||||
# Activate license
|
||||
$ACTIVATION_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "C:\Program Files\Unity\Hub\Editor\${env:UNITY_VERSION}\editor\Unity.exe" -ArgumentList "-batchmode -nographics -logFile $ACTIVATE_LICENSE_PATH\activate.log -quit -serial ${env:UNITY_SERIAL} -username ${env:UNITY_EMAIL} -password ${env:UNITY_PASSWORD}"
|
||||
|
||||
# Store the exit code from the verify command
|
||||
$UNITY_EXIT_CODE = $ACTIVATION_OUTPUT.ExitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
#
|
||||
# NO LICENSE ACTIVATION STRATEGY MATCHED
|
||||
#
|
||||
# This will exit since no activation strategies could be matched.
|
||||
#
|
||||
Write-Output "License activation strategy could not be determined."
|
||||
Write-Output ""
|
||||
Write-Output "Visit https://game.ci/docs/github/getting-started for more"
|
||||
Write-Output "details on how to set up one of the possible activation strategies."
|
||||
|
||||
# Immediately exit as no UNITY_EXIT_CODE can be derived.
|
||||
exit 1;
|
||||
}
|
||||
|
||||
#
|
||||
# Display information about the result
|
||||
#
|
||||
Get-Content $ACTIVATE_LICENSE_PATH\activate.log
|
||||
if ($UNITY_EXIT_CODE -eq 0)
|
||||
{
|
||||
# Activation was a success
|
||||
Write-Output "Activation complete."
|
||||
}
|
||||
else
|
||||
{
|
||||
# Activation failed so exit with the code from the license verification step
|
||||
Write-Output "Unclassified error occured while trying to activate license."
|
||||
Write-Output "Exit code was: $UNITY_EXIT_CODE"
|
||||
exit $UNITY_EXIT_CODE
|
||||
}
|
||||
|
||||
# Return to previous working directory
|
||||
Pop-Location
|
||||
14
dist/steps/activate.sh
vendored
14
dist/steps/activate.sh
vendored
@@ -77,7 +77,21 @@ elif [[ -n "$UNITY_SERIAL" && -n "$UNITY_EMAIL" && -n "$UNITY_PASSWORD" ]]; then
|
||||
|
||||
# Store the exit code from the verify command
|
||||
UNITY_EXIT_CODE=$?
|
||||
elif [[ -n "$UNITY_LICENSING_SERVER" ]]; then
|
||||
#
|
||||
# Custom Unity License Server
|
||||
#
|
||||
echo "Adding licensing server config"
|
||||
|
||||
/opt/unity/Editor/Data/Resources/Licensing/Client/Unity.Licensing.Client --acquire-floating > license.txt #is this accessible in a env variable?
|
||||
UNITY_EXIT_CODE=$?
|
||||
PARSEDFILE=$(grep -oP '\".*?\"' < license.txt | tr -d '"')
|
||||
export FLOATING_LICENSE
|
||||
FLOATING_LICENSE=$(sed -n 2p <<< "$PARSEDFILE")
|
||||
FLOATING_LICENSE_TIMEOUT=$(sed -n 4p <<< "$PARSEDFILE")
|
||||
|
||||
echo "Acquired floating license: \"$FLOATING_LICENSE\" with timeout $FLOATING_LICENSE_TIMEOUT"
|
||||
# Store the exit code from the verify command
|
||||
else
|
||||
#
|
||||
# NO LICENSE ACTIVATION STRATEGY MATCHED
|
||||
|
||||
18
dist/steps/return_license.ps1
vendored
Normal file
18
dist/steps/return_license.ps1
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# Run in ACTIVATE_LICENSE_PATH directory
|
||||
Write-Output "Changing to $ACTIVATE_LICENSE_PATH directory."
|
||||
Push-Location "$ACTIVATE_LICENSE_PATH"
|
||||
|
||||
if ($null -ne ${env:UNITY_SERIAL})
|
||||
{
|
||||
#
|
||||
# PROFESSIONAL (SERIAL) LICENSE MODE
|
||||
#
|
||||
# This will return the license that is currently in use.
|
||||
#
|
||||
$RETURN_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "C:\Program Files\Unity\Hub\Editor\${env:UNITY_VERSION}\editor\Unity.exe" -ArgumentList "-batchmode -nographics -logFile $FULL_ARTIFACTS_PATH\deactivate.log -quit -returnlicense"
|
||||
|
||||
Get-Content $FULL_ARTIFACTS_PATH\deactivate.log
|
||||
}
|
||||
|
||||
# Return to previous working directory
|
||||
Pop-Location
|
||||
9
dist/steps/return_license.sh
vendored
9
dist/steps/return_license.sh
vendored
@@ -4,7 +4,13 @@
|
||||
echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory."
|
||||
pushd "$ACTIVATE_LICENSE_PATH"
|
||||
|
||||
if [[ -n "$UNITY_SERIAL" ]]; then
|
||||
if [[ -n "$UNITY_LICENSING_SERVER" ]]; then #
|
||||
#
|
||||
# Return any floating license used.
|
||||
#
|
||||
echo "Returning floating license: \"$FLOATING_LICENSE\""
|
||||
/opt/unity/Editor/Data/Resources/Licensing/Client/Unity.Licensing.Client --return-floating "$FLOATING_LICENSE"
|
||||
elif [[ -n "$UNITY_SERIAL" ]]; then
|
||||
#
|
||||
# PROFESSIONAL (SERIAL) LICENSE MODE
|
||||
#
|
||||
@@ -17,6 +23,5 @@ if [[ -n "$UNITY_SERIAL" ]]; then
|
||||
-quit \
|
||||
-returnlicense
|
||||
fi
|
||||
|
||||
# Return to previous working directory
|
||||
popd
|
||||
|
||||
165
dist/steps/run_tests.ps1
vendored
Normal file
165
dist/steps/run_tests.ps1
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
#
|
||||
# Set and display project path
|
||||
#
|
||||
|
||||
$UNITY_PROJECT_PATH = "${env:GITHUB_WORKSPACE}/${env:PROJECT_PATH}"
|
||||
Write-Output "Using project path $UNITY_PROJECT_PATH"
|
||||
|
||||
#
|
||||
# Set and display the artifacts path
|
||||
#
|
||||
|
||||
Write-Output "Using artifacts path ${env:ARTIFACTS_PATH} to save test results."
|
||||
$FULL_ARTIFACTS_PATH = "${env:GITHUB_WORKSPACE}\${env:ARTIFACTS_PATH}"
|
||||
|
||||
#
|
||||
# Set and display the coverage results path
|
||||
#
|
||||
|
||||
Write-Output "Using coverage results path ${env:COVERAGE_RESULTS_PATH} to save test coverage results."
|
||||
$FULL_COVERAGE_RESULTS_PATH = "${env:GITHUB_WORKSPACE}\${env:COVERAGE_RESULTS_PATH}"
|
||||
|
||||
#
|
||||
# Display custom parameters
|
||||
#
|
||||
|
||||
Write-Output "Using custom parameters ${env:CUSTOM_PARAMETERS}"
|
||||
|
||||
# The following tests are 2019 mode (requires Unity 2019.2.11f1 or later)
|
||||
# Reference: https://docs.unity3d.com/2019.3/Documentation/Manual/CommandLineArguments.html
|
||||
|
||||
#
|
||||
# Display the unity version
|
||||
#
|
||||
|
||||
Write-Output "Using Unity version ${env:UNITY_VERSION} to test."
|
||||
|
||||
#
|
||||
# Overall info
|
||||
#
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "###########################"
|
||||
Write-Output "# Artifacts folder #"
|
||||
Write-Output "###########################"
|
||||
Write-Output ""
|
||||
Write-Output "Creating $FULL_ARTIFACTS_PATH if it does not exist."
|
||||
New-Item -Path "$FULL_ARTIFACTS_PATH" -ItemType Directory
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "###########################"
|
||||
Write-Output "# Project directory #"
|
||||
Write-Output "###########################"
|
||||
Write-Output ""
|
||||
Get-ChildItem -Hidden -Path $UNITY_PROJECT_PATH
|
||||
|
||||
#
|
||||
# Testing for each platform
|
||||
#
|
||||
foreach ( $platform in ${env:TEST_PLATFORMS}.Split(";") )
|
||||
{
|
||||
if ( "$platform" -eq "standalone" )
|
||||
{
|
||||
Write-Output ""
|
||||
Write-Output "###########################"
|
||||
Write-Output "# Building Standalone #"
|
||||
Write-Output "###########################"
|
||||
Write-Output ""
|
||||
|
||||
# Create directories if they do not exist
|
||||
if(-Not (Test-Path -Path $Env:UNITY_PROJECT_PATH\Assets\Editor))
|
||||
{
|
||||
# We use -Force to suppress output, doesn't overwrite anything
|
||||
New-Item -ItemType Directory -Force -Path $Env:UNITY_PROJECT_PATH\Assets\Editor
|
||||
}
|
||||
if(-Not (Test-Path -Path $Env:UNITY_PROJECT_PATH\Assets\Player))
|
||||
{
|
||||
# We use -Force to suppress output, doesn't overwrite anything
|
||||
New-Item -ItemType Directory -Force -Path $Env:UNITY_PROJECT_PATH\Assets\Player
|
||||
}
|
||||
|
||||
# Copy the scripts
|
||||
Copy-Item -Path "c:\UnityStandaloneScripts\Assets\Editor" -Destination $Env:UNITY_PROJECT_PATH\Assets\Editor -Recurse
|
||||
Copy-Item -Path "c:\UnityStandaloneScripts\Assets\Player" -Destination $Env:UNITY_PROJECT_PATH\Assets\Player -Recurse
|
||||
|
||||
# Verify recursive paths
|
||||
Get-ChildItem -Path $Env:UNITY_PROJECT_PATH\Assets\Editor -Recurse
|
||||
Get-ChildItem -Path $Env:UNITY_PROJECT_PATH\Assets\Player -Recurse
|
||||
|
||||
$runTests="-runTests -testPlatform StandaloneWindows64 -builtTestRunnerPath $UNITY_PROJECT_PATH\Build\UnityTestRunner-Standalone.exe"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Output ""
|
||||
Write-Output "###########################"
|
||||
Write-Output "# Testing in $platform #"
|
||||
Write-Output "###########################"
|
||||
Write-Output ""
|
||||
|
||||
if ( $platform -ne "COMBINE_RESULTS" )
|
||||
{
|
||||
$runTests = "-runTests -testPlatform $platform -testResults $FULL_ARTIFACTS_PATH/$platform-results.xml"
|
||||
}
|
||||
else
|
||||
{
|
||||
$runTests = "-quit"
|
||||
}
|
||||
}
|
||||
|
||||
$TEST_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "C:\Program Files\Unity\Hub\Editor\${env:UNITY_VERSION}\editor\Unity.exe" -ArgumentList "-batchmode -logFile $FULL_ARTIFACTS_PATH\$platform.log -projectPath $UNITY_PROJECT_PATH -coverageResultsPath $FULL_COVERAGE_RESULTS_PATH $runTests -enableCodeCoverage -debugCodeOptimization -coverageOptions ${env:COVERAGE_OPTIONS} ${env:CUSTOM_PARAMETERS}"
|
||||
|
||||
# Catch exit code
|
||||
$TEST_EXIT_CODE = $TEST_OUTPUT.ExitCode
|
||||
|
||||
# Print unity log output
|
||||
Get-Content "$FULL_ARTIFACTS_PATH/$platform.log"
|
||||
|
||||
if ( ( $TEST_EXIT_CODE -eq 0 ) -and ( "$platform" -eq "standalone" ) )
|
||||
{
|
||||
# Code Coverage currently only supports code ran in the Editor and not in Standalone/Player.
|
||||
# https://docs.unity.cn/Packages/com.unity.testtools.codecoverage@1.1/manual/TechnicalDetails.html#how-it-works
|
||||
|
||||
$TEST_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "$UNITY_PROJECT_PATH\Build\UnityTestRunner-Standalone.exe" -ArgumentList "-batchmode -nographics -logFile $FULL_ARTIFACTS_PATH\$platform-player.log -testResults $FULL_ARTIFACTS_PATH\$platform-results.xml"
|
||||
|
||||
# Catch exit code
|
||||
$TEST_EXIT_CODE = $TEST_OUTPUT.ExitCode
|
||||
|
||||
# Print player log output
|
||||
Get-Content "$FULL_ARTIFACTS_PATH/$platform-player.log"
|
||||
}
|
||||
|
||||
# Display results
|
||||
if ($TEST_EXIT_CODE -eq 0)
|
||||
{
|
||||
Write-Output "Run succeeded, no failures occurred";
|
||||
}
|
||||
elseif ($TEST_EXIT_CODE -eq 2)
|
||||
{
|
||||
Write-Output "Run succeeded, some tests failed";
|
||||
}
|
||||
elseif ($TEST_EXIT_CODE -eq 3)
|
||||
{
|
||||
Write-Output "Run failure (other failure)";
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Output "Unexpected exit code $TEST_EXIT_CODE";
|
||||
}
|
||||
|
||||
if ( $TEST_EXIT_CODE -ne 0)
|
||||
{
|
||||
$TEST_RUNNER_EXIT_CODE = $TEST_EXIT_CODE
|
||||
}
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "###########################"
|
||||
Write-Output "# $platform Results #"
|
||||
Write-Output "###########################"
|
||||
Write-Output ""
|
||||
|
||||
if ($platform -ne "COMBINE_RESULTS")
|
||||
{
|
||||
Get-Content "$FULL_ARTIFACTS_PATH/$platform-results.xml"
|
||||
Get-Content "$FULL_ARTIFACTS_PATH/$platform-results.xml" | Select-String "test-run" | Select-String "Passed"
|
||||
}
|
||||
}
|
||||
145
dist/steps/run_tests.sh
vendored
145
dist/steps/run_tests.sh
vendored
@@ -36,6 +36,76 @@ echo "Using custom parameters $CUSTOM_PARAMETERS."
|
||||
|
||||
echo "Using Unity version \"$UNITY_VERSION\" to test."
|
||||
|
||||
#
|
||||
# Create an empty project for testing if in package mode
|
||||
#
|
||||
|
||||
if [ "$PACKAGE_MODE" = "true" ]; then
|
||||
echo "Running tests on a Unity package rather than a Unity project."
|
||||
|
||||
if ! command -v jq &> /dev/null
|
||||
then
|
||||
echo "jq could not be found. This is required for package mode, and is likely the result of using a custom Docker image. Please use the default image or install jq to your custom image."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "###########################"
|
||||
echo "# Package Folder #"
|
||||
echo "###########################"
|
||||
echo ""
|
||||
|
||||
ls -la "$UNITY_PROJECT_PATH"
|
||||
echo ""
|
||||
|
||||
echo "Creating an empty Unity project to add the package $PACKAGE_NAME to."
|
||||
|
||||
TEMP_PROJECT_PATH="./TempProject"
|
||||
|
||||
unity-editor \
|
||||
-batchmode \
|
||||
-createProject "$TEMP_PROJECT_PATH" \
|
||||
-quit
|
||||
|
||||
# use jq to add the package to the temp project through manually modifying Packages/manifest.json
|
||||
echo "Adding package to the temporary project's dependencies and testables..."
|
||||
echo ""
|
||||
|
||||
PACKAGE_MANIFEST_PATH="$TEMP_PROJECT_PATH/Packages/manifest.json"
|
||||
if [ ! -f "$PACKAGE_MANIFEST_PATH" ]; then
|
||||
echo "Packages/mainfest.json was not created properly. This indicates a problem with the Action, not with your package. Logging directories and aborting..."
|
||||
|
||||
echo ""
|
||||
echo "###########################"
|
||||
echo "# Temp Project Folder #"
|
||||
echo "###########################"
|
||||
echo ""
|
||||
|
||||
ls -a "$TEMP_PROJECT_PATH"
|
||||
|
||||
echo ""
|
||||
echo "################################"
|
||||
echo "# Temp Project Packages Folder #"
|
||||
echo "################################"
|
||||
echo ""
|
||||
|
||||
ls -a "$TEMP_PROJECT_PATH/Packages"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PACKAGE_MANIFEST_JSON=$(cat "$PACKAGE_MANIFEST_PATH")
|
||||
echo "$PACKAGE_MANIFEST_JSON" | \
|
||||
jq \
|
||||
--arg packageName "$PACKAGE_NAME" \
|
||||
--arg projectPath "$UNITY_PROJECT_PATH" \
|
||||
'.dependencies += {"com.unity.testtools.codecoverage": "1.1.1"} | .dependencies += {"\($packageName)": "file:\($projectPath)"} | . += {testables: ["\($packageName)"]}' \
|
||||
> "$PACKAGE_MANIFEST_PATH"
|
||||
|
||||
UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Overall info
|
||||
#
|
||||
@@ -59,16 +129,36 @@ ls -alh $UNITY_PROJECT_PATH
|
||||
# Testing for each platform
|
||||
#
|
||||
for platform in ${TEST_PLATFORMS//;/ }; do
|
||||
echo ""
|
||||
echo "###########################"
|
||||
echo "# Testing in $platform #"
|
||||
echo "###########################"
|
||||
echo ""
|
||||
if [[ "$platform" == "standalone" ]]; then
|
||||
echo ""
|
||||
echo "###########################"
|
||||
echo "# Building Standalone #"
|
||||
echo "###########################"
|
||||
echo ""
|
||||
|
||||
if [[ "$platform" != "COMBINE_RESULTS" ]]; then
|
||||
runTests="-runTests -testPlatform $platform -testResults $FULL_ARTIFACTS_PATH/$platform-results.xml"
|
||||
# Create directories if they do not exist
|
||||
mkdir -p "$UNITY_PROJECT_PATH/Assets/Editor/"
|
||||
mkdir -p "$UNITY_PROJECT_PATH/Assets/Player/"
|
||||
# Copy the scripts
|
||||
cp -R "$ACTION_FOLDER/UnityStandaloneScripts/Assets/Editor/" "$UNITY_PROJECT_PATH/Assets/Editor/"
|
||||
cp -R "$ACTION_FOLDER/UnityStandaloneScripts/Assets/Player/" "$UNITY_PROJECT_PATH/Assets/Player/"
|
||||
# Verify recursive paths
|
||||
ls -Ralph "$UNITY_PROJECT_PATH/Assets/Editor/"
|
||||
ls -Ralph "$UNITY_PROJECT_PATH/Assets/Player/"
|
||||
|
||||
runTests="-runTests -testPlatform StandaloneLinux64 -builtTestRunnerPath $UNITY_PROJECT_PATH/Build/UnityTestRunner-Standalone"
|
||||
else
|
||||
runTests="-quit"
|
||||
echo ""
|
||||
echo "###########################"
|
||||
echo "# Testing in $platform #"
|
||||
echo "###########################"
|
||||
echo ""
|
||||
|
||||
if [[ "$platform" != "COMBINE_RESULTS" ]]; then
|
||||
runTests="-runTests -testPlatform $platform -testResults $FULL_ARTIFACTS_PATH/$platform-results.xml"
|
||||
else
|
||||
runTests="-quit"
|
||||
fi
|
||||
fi
|
||||
|
||||
unity-editor \
|
||||
@@ -88,6 +178,29 @@ for platform in ${TEST_PLATFORMS//;/ }; do
|
||||
# Print unity log output
|
||||
cat "$FULL_ARTIFACTS_PATH/$platform.log"
|
||||
|
||||
if [[ $TEST_EXIT_CODE -eq 0 && "$platform" == "standalone" ]]; then
|
||||
echo ""
|
||||
echo "###########################"
|
||||
echo "# Testing Standalone #"
|
||||
echo "###########################"
|
||||
echo ""
|
||||
|
||||
# Code Coverage currently only supports code ran in the Editor and not in Standalone/Player.
|
||||
# https://docs.unity.cn/Packages/com.unity.testtools.codecoverage@1.1/manual/TechnicalDetails.html#how-it-works
|
||||
|
||||
xvfb-run -a -e /dev/stdout "$UNITY_PROJECT_PATH/Build/UnityTestRunner-Standalone" \
|
||||
-batchmode \
|
||||
-nographics \
|
||||
-logFile "$FULL_ARTIFACTS_PATH/$platform-player.log" \
|
||||
-testResults "$FULL_ARTIFACTS_PATH/$platform-results.xml"
|
||||
|
||||
# Catch exit code
|
||||
TEST_EXIT_CODE=$?
|
||||
|
||||
# Print player log output
|
||||
cat "$FULL_ARTIFACTS_PATH/$platform-player.log"
|
||||
fi
|
||||
|
||||
# Display results
|
||||
if [ $TEST_EXIT_CODE -eq 0 ]; then
|
||||
echo "Run succeeded, no failures occurred";
|
||||
@@ -114,3 +227,19 @@ for platform in ${TEST_PLATFORMS//;/ }; do
|
||||
cat "$FULL_ARTIFACTS_PATH/$platform-results.xml" | grep test-run | grep Passed
|
||||
fi
|
||||
done
|
||||
|
||||
#
|
||||
# Permissions
|
||||
#
|
||||
|
||||
# Make a given user owner of all artifacts
|
||||
if [[ -n "$CHOWN_FILES_TO" ]]; then
|
||||
chown -R "$CHOWN_FILES_TO" "$UNITY_PROJECT_PATH"
|
||||
chown -R "$CHOWN_FILES_TO" "$FULL_ARTIFACTS_PATH"
|
||||
chown -R "$CHOWN_FILES_TO" "$FULL_COVERAGE_RESULTS_PATH"
|
||||
fi
|
||||
|
||||
# Add read permissions for everyone to all artifacts
|
||||
chmod -R a+r "$UNITY_PROJECT_PATH"
|
||||
chmod -R a+r "$FULL_ARTIFACTS_PATH"
|
||||
chmod -R a+r "$FULL_COVERAGE_RESULTS_PATH"
|
||||
|
||||
22
dist/steps/set_gitcredential.ps1
vendored
Normal file
22
dist/steps/set_gitcredential.ps1
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
if ($null -eq ${env:GIT_PRIVATE_TOKEN})
|
||||
{
|
||||
Write-Output "GIT_PRIVATE_TOKEN unset skipping"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Output "GIT_PRIVATE_TOKEN is set configuring git credentials"
|
||||
|
||||
git config --global credential.helper store
|
||||
git config --global --replace-all url.https://github.com/.insteadOf ssh://git@github.com/
|
||||
git config --global --add url.https://github.com/.insteadOf git@github.com
|
||||
|
||||
git config --global url."https://token:${env:GIT_PRIVATE_TOKEN}@github.com/".insteadOf "https://github.com/"
|
||||
git config --global url."https://ssh:${env:GIT_PRIVATE_TOKEN}@github.com/".insteadOf "ssh://git@github.com/"
|
||||
git config --global url."https://git:${env:GIT_PRIVATE_TOKEN}@github.com/".insteadOf "git@github.com:"
|
||||
}
|
||||
|
||||
Write-Output "---------- git config --list -------------"
|
||||
git config --list
|
||||
|
||||
Write-Output "---------- git config --list --show-origin -------------"
|
||||
git config --list --show-origin
|
||||
56
dist/test-standalone-scripts/.gitignore
vendored
Normal file
56
dist/test-standalone-scripts/.gitignore
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Note: Non default ignore file, as this only tests Builder script.
|
||||
#
|
||||
|
||||
[Ll]ibrary/
|
||||
[Tt]emp/
|
||||
[Oo]bj/
|
||||
[Bb]uild/
|
||||
[Bb]uilds/
|
||||
[Ll]ogs/
|
||||
|
||||
# Additional ignores
|
||||
[Bb]in/
|
||||
|
||||
# Uncomment this line if you wish to ignore the asset store tools plugin
|
||||
# [Aa]ssets/AssetStoreTools*
|
||||
|
||||
# IDEs
|
||||
.vs/
|
||||
.idea/
|
||||
|
||||
# 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
|
||||
|
||||
# Crashlytics generated file
|
||||
crashlytics-build.properties
|
||||
8
dist/test-standalone-scripts/Assets/Editor.meta
vendored
Normal file
8
dist/test-standalone-scripts/Assets/Editor.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dea28d93f6267af4f8661eb2043f749a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
dist/test-standalone-scripts/Assets/Editor/UnityTestRunnerAction.meta
vendored
Normal file
8
dist/test-standalone-scripts/Assets/Editor/UnityTestRunnerAction.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0cf2129f2cbdf3b4185e808b8098349d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
49
dist/test-standalone-scripts/Assets/Editor/UnityTestRunnerAction/PlayerBuildModifier.cs
vendored
Normal file
49
dist/test-standalone-scripts/Assets/Editor/UnityTestRunnerAction/PlayerBuildModifier.cs
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.TestTools;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
using UnityTestRunnerAction;
|
||||
|
||||
[assembly: TestPlayerBuildModifier(typeof(HeadlessPlayModeSetup))]
|
||||
[assembly: PostBuildCleanup(typeof(HeadlessPlayModeSetup))]
|
||||
|
||||
namespace UnityTestRunnerAction
|
||||
{
|
||||
public class HeadlessPlayModeSetup : ITestPlayerBuildModifier, IPostBuildCleanup
|
||||
{
|
||||
private static bool s_RunningPlayerTests;
|
||||
public BuildPlayerOptions ModifyOptions(BuildPlayerOptions playerOptions)
|
||||
{
|
||||
// Do not launch the player after the build completes. Disable the PlayerConnection.
|
||||
playerOptions.options &= ~(BuildOptions.AutoRunPlayer | BuildOptions.ConnectToHost | BuildOptions.WaitForPlayerConnection);
|
||||
|
||||
// Not supporting Mac currently.
|
||||
playerOptions.target = SystemInfo.operatingSystemFamily == OperatingSystemFamily.Windows ? BuildTarget.StandaloneWindows64 : BuildTarget.StandaloneLinux64;
|
||||
|
||||
string[] commandLineArgs = Environment.GetCommandLineArgs();
|
||||
playerOptions.locationPathName = commandLineArgs[Array.IndexOf(commandLineArgs, "-builtTestRunnerPath") + 1]; ;
|
||||
|
||||
// Instruct the cleanup to exit the Editor if the run came from the command line.
|
||||
// The variable is static because the cleanup is being invoked in a new instance of the class.
|
||||
s_RunningPlayerTests = true;
|
||||
return playerOptions;
|
||||
}
|
||||
|
||||
public void Cleanup()
|
||||
{
|
||||
if (s_RunningPlayerTests && IsRunningTestsFromCommandLine())
|
||||
{
|
||||
// Exit the Editor on the next update, allowing for other PostBuildCleanup steps to run.
|
||||
EditorApplication.update += () => { EditorApplication.Exit(0); };
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsRunningTestsFromCommandLine()
|
||||
{
|
||||
var commandLineArgs = Environment.GetCommandLineArgs();
|
||||
return commandLineArgs.Any(value => value == "-runTests");
|
||||
}
|
||||
}
|
||||
}
|
||||
11
dist/test-standalone-scripts/Assets/Editor/UnityTestRunnerAction/PlayerBuildModifier.cs.meta
vendored
Normal file
11
dist/test-standalone-scripts/Assets/Editor/UnityTestRunnerAction/PlayerBuildModifier.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 500127a78ea2408479825b0807929249
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
dist/test-standalone-scripts/Assets/Player.meta
vendored
Normal file
8
dist/test-standalone-scripts/Assets/Player.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbe67f3a46ffb8643acd08c86957d9bf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction.meta
vendored
Normal file
8
dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d97b4f9ec1fb744a9aab82d6c21100d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
92
dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction/TestRunCallback.cs
vendored
Normal file
92
dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction/TestRunCallback.cs
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
using NUnit.Framework.Interfaces;
|
||||
using System;
|
||||
using System.Xml;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestRunner;
|
||||
using UnityTestRunnerAction;
|
||||
|
||||
[assembly: TestRunCallback(typeof(MyTestRunCallback))]
|
||||
|
||||
namespace UnityTestRunnerAction
|
||||
{
|
||||
public class MyTestRunCallback : ITestRunCallback
|
||||
{
|
||||
private const string k_nUnitVersion = "3.5.0.0";
|
||||
|
||||
private const string k_TestRunNode = "test-run";
|
||||
private const string k_Id = "id";
|
||||
private const string k_Testcasecount = "testcasecount";
|
||||
private const string k_Result = "result";
|
||||
private const string k_Total = "total";
|
||||
private const string k_Passed = "passed";
|
||||
private const string k_Failed = "failed";
|
||||
private const string k_Inconclusive = "inconclusive";
|
||||
private const string k_Skipped = "skipped";
|
||||
private const string k_Asserts = "asserts";
|
||||
private const string k_EngineVersion = "engine-version";
|
||||
private const string k_ClrVersion = "clr-version";
|
||||
private const string k_StartTime = "start-time";
|
||||
private const string k_EndTime = "end-time";
|
||||
private const string k_Duration = "duration";
|
||||
|
||||
private const string k_TimeFormat = "u";
|
||||
|
||||
private ITest fullTest;
|
||||
|
||||
public void RunStarted(ITest testsToRun)
|
||||
{
|
||||
if (fullTest == null)
|
||||
{
|
||||
fullTest = testsToRun;
|
||||
}
|
||||
}
|
||||
|
||||
public void RunFinished(ITestResult testResults)
|
||||
{
|
||||
if (testResults.Test != fullTest)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string[] commandLineArgs = Environment.GetCommandLineArgs();
|
||||
string testResultsPath = commandLineArgs[Array.IndexOf(commandLineArgs, "-testResults") + 1];
|
||||
using (var writer = XmlWriter.Create(testResultsPath, new XmlWriterSettings() { Indent = true }))
|
||||
{
|
||||
// Manually add the outer test-run node, because testResults.ToXml doesn't include it.
|
||||
|
||||
var testRunNode = new TNode(k_TestRunNode);
|
||||
|
||||
testRunNode.AddAttribute(k_Id, "2");
|
||||
testRunNode.AddAttribute(k_Testcasecount, (testResults.PassCount + testResults.FailCount + testResults.SkipCount + testResults.InconclusiveCount).ToString());
|
||||
testRunNode.AddAttribute(k_Result, testResults.ResultState.ToString());
|
||||
testRunNode.AddAttribute(k_Total, (testResults.PassCount + testResults.FailCount + testResults.SkipCount + testResults.InconclusiveCount).ToString());
|
||||
testRunNode.AddAttribute(k_Passed, testResults.PassCount.ToString());
|
||||
testRunNode.AddAttribute(k_Failed, testResults.FailCount.ToString());
|
||||
testRunNode.AddAttribute(k_Inconclusive, testResults.InconclusiveCount.ToString());
|
||||
testRunNode.AddAttribute(k_Skipped, testResults.SkipCount.ToString());
|
||||
testRunNode.AddAttribute(k_Asserts, testResults.AssertCount.ToString());
|
||||
testRunNode.AddAttribute(k_EngineVersion, k_nUnitVersion);
|
||||
testRunNode.AddAttribute(k_ClrVersion, Environment.Version.ToString());
|
||||
testRunNode.AddAttribute(k_StartTime, testResults.StartTime.ToString(k_TimeFormat));
|
||||
testRunNode.AddAttribute(k_EndTime, testResults.EndTime.ToString(k_TimeFormat));
|
||||
testRunNode.AddAttribute(k_Duration, testResults.Duration.ToString());
|
||||
|
||||
var resultNode = testResults.ToXml(true);
|
||||
testRunNode.ChildNodes.Add(resultNode);
|
||||
|
||||
testRunNode.WriteTo(writer);
|
||||
writer.Flush();
|
||||
}
|
||||
|
||||
Application.Quit(testResults.ResultState.Status == TestStatus.Failed ? 2 : 0);
|
||||
}
|
||||
|
||||
public void TestStarted(ITest test)
|
||||
{
|
||||
}
|
||||
|
||||
public void TestFinished(ITestResult result)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
11
dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction/TestRunCallback.cs.meta
vendored
Normal file
11
dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction/TestRunCallback.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee1aa3805d7b51f46a3ddefe39d76ba5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction/UnityTestRunnerAction.asmdef
vendored
Normal file
15
dist/test-standalone-scripts/Assets/Player/UnityTestRunnerAction/UnityTestRunnerAction.asmdef
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "UnityTestRunnerAction",
|
||||
"references": [
|
||||
"GUID:27619889b8ba8c24980f49ee34dbb44a"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"nunit.framework.dll"
|
||||
],
|
||||
"autoReferenced": false,
|
||||
"defineConstraints": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a9bfe020dc3a8747afebc3a87516973
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
49
dist/test-standalone-scripts/Packages/manifest.json
vendored
Normal file
49
dist/test-standalone-scripts/Packages/manifest.json
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.2d.tilemap": "1.0.0",
|
||||
"com.unity.ads": "2.0.8",
|
||||
"com.unity.analytics": "3.3.2",
|
||||
"com.unity.collab-proxy": "1.2.16",
|
||||
"com.unity.ext.nunit": "1.0.0",
|
||||
"com.unity.ide.rider": "1.1.0",
|
||||
"com.unity.ide.vscode": "1.1.2",
|
||||
"com.unity.package-manager-ui": "2.2.0",
|
||||
"com.unity.purchasing": "2.0.6",
|
||||
"com.unity.test-framework": "1.0.18",
|
||||
"com.unity.textmeshpro": "2.0.1",
|
||||
"com.unity.timeline": "1.1.0",
|
||||
"com.unity.ugui": "1.0.0",
|
||||
"com.unity.modules.ai": "1.0.0",
|
||||
"com.unity.modules.androidjni": "1.0.0",
|
||||
"com.unity.modules.animation": "1.0.0",
|
||||
"com.unity.modules.assetbundle": "1.0.0",
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.cloth": "1.0.0",
|
||||
"com.unity.modules.director": "1.0.0",
|
||||
"com.unity.modules.imageconversion": "1.0.0",
|
||||
"com.unity.modules.imgui": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0",
|
||||
"com.unity.modules.particlesystem": "1.0.0",
|
||||
"com.unity.modules.physics": "1.0.0",
|
||||
"com.unity.modules.physics2d": "1.0.0",
|
||||
"com.unity.modules.screencapture": "1.0.0",
|
||||
"com.unity.modules.terrain": "1.0.0",
|
||||
"com.unity.modules.terrainphysics": "1.0.0",
|
||||
"com.unity.modules.tilemap": "1.0.0",
|
||||
"com.unity.modules.ui": "1.0.0",
|
||||
"com.unity.modules.uielements": "1.0.0",
|
||||
"com.unity.modules.umbra": "1.0.0",
|
||||
"com.unity.modules.unityanalytics": "1.0.0",
|
||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
|
||||
"com.unity.modules.unitywebrequestaudio": "1.0.0",
|
||||
"com.unity.modules.unitywebrequesttexture": "1.0.0",
|
||||
"com.unity.modules.unitywebrequestwww": "1.0.0",
|
||||
"com.unity.modules.vehicles": "1.0.0",
|
||||
"com.unity.modules.video": "1.0.0",
|
||||
"com.unity.modules.vr": "1.0.0",
|
||||
"com.unity.modules.wind": "1.0.0",
|
||||
"com.unity.modules.xr": "1.0.0"
|
||||
}
|
||||
}
|
||||
BIN
dist/test-standalone-scripts/ProjectSettings/AudioManager.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/AudioManager.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/ClusterInputManager.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/ClusterInputManager.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/DynamicsManager.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/DynamicsManager.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/EditorBuildSettings.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/EditorBuildSettings.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/EditorSettings.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/EditorSettings.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/GraphicsSettings.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/GraphicsSettings.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/InputManager.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/InputManager.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/NavMeshAreas.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/NavMeshAreas.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/Physics2DSettings.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/Physics2DSettings.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/PresetManager.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/PresetManager.asset
vendored
Normal file
Binary file not shown.
619
dist/test-standalone-scripts/ProjectSettings/ProjectSettings.asset
vendored
Normal file
619
dist/test-standalone-scripts/ProjectSettings/ProjectSettings.asset
vendored
Normal file
@@ -0,0 +1,619 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!129 &1
|
||||
PlayerSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 18
|
||||
productGUID: 52397747394a6224aa209092f5947d3d
|
||||
AndroidProfiler: 0
|
||||
AndroidFilterTouchesWhenObscured: 0
|
||||
AndroidEnableSustainedPerformanceMode: 0
|
||||
defaultScreenOrientation: 4
|
||||
targetDevice: 2
|
||||
useOnDemandResources: 0
|
||||
accelerometerFrequency: 60
|
||||
companyName: DefaultCompany
|
||||
productName: test-standalone-scripts
|
||||
defaultCursor: {fileID: 0}
|
||||
cursorHotspot: {x: 0, y: 0}
|
||||
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
|
||||
m_ShowUnitySplashScreen: 1
|
||||
m_ShowUnitySplashLogo: 1
|
||||
m_SplashScreenOverlayOpacity: 1
|
||||
m_SplashScreenAnimation: 1
|
||||
m_SplashScreenLogoStyle: 1
|
||||
m_SplashScreenDrawMode: 0
|
||||
m_SplashScreenBackgroundAnimationZoom: 1
|
||||
m_SplashScreenLogoAnimationZoom: 1
|
||||
m_SplashScreenBackgroundLandscapeAspect: 1
|
||||
m_SplashScreenBackgroundPortraitAspect: 1
|
||||
m_SplashScreenBackgroundLandscapeUvs:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
m_SplashScreenBackgroundPortraitUvs:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
m_SplashScreenLogos: []
|
||||
m_VirtualRealitySplashScreen: {fileID: 0}
|
||||
m_HolographicTrackingLossScreen: {fileID: 0}
|
||||
defaultScreenWidth: 1024
|
||||
defaultScreenHeight: 768
|
||||
defaultScreenWidthWeb: 960
|
||||
defaultScreenHeightWeb: 600
|
||||
m_StereoRenderingPath: 0
|
||||
m_ActiveColorSpace: 0
|
||||
m_MTRendering: 1
|
||||
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
|
||||
iosShowActivityIndicatorOnLoading: -1
|
||||
androidShowActivityIndicatorOnLoading: -1
|
||||
displayResolutionDialog: 0
|
||||
iosUseCustomAppBackgroundBehavior: 0
|
||||
iosAllowHTTPDownload: 1
|
||||
allowedAutorotateToPortrait: 1
|
||||
allowedAutorotateToPortraitUpsideDown: 1
|
||||
allowedAutorotateToLandscapeRight: 1
|
||||
allowedAutorotateToLandscapeLeft: 1
|
||||
useOSAutorotation: 1
|
||||
use32BitDisplayBuffer: 1
|
||||
preserveFramebufferAlpha: 0
|
||||
disableDepthAndStencilBuffers: 0
|
||||
androidStartInFullscreen: 1
|
||||
androidRenderOutsideSafeArea: 1
|
||||
androidUseSwappy: 0
|
||||
androidBlitType: 0
|
||||
defaultIsNativeResolution: 1
|
||||
macRetinaSupport: 1
|
||||
runInBackground: 0
|
||||
captureSingleScreen: 0
|
||||
muteOtherAudioSources: 0
|
||||
Prepare IOS For Recording: 0
|
||||
Force IOS Speakers When Recording: 0
|
||||
deferSystemGesturesMode: 0
|
||||
hideHomeButton: 0
|
||||
submitAnalytics: 1
|
||||
usePlayerLog: 1
|
||||
bakeCollisionMeshes: 0
|
||||
forceSingleInstance: 0
|
||||
useFlipModelSwapchain: 1
|
||||
resizableWindow: 0
|
||||
useMacAppStoreValidation: 0
|
||||
macAppStoreCategory: public.app-category.games
|
||||
gpuSkinning: 0
|
||||
graphicsJobs: 0
|
||||
xboxPIXTextureCapture: 0
|
||||
xboxEnableAvatar: 0
|
||||
xboxEnableKinect: 0
|
||||
xboxEnableKinectAutoTracking: 0
|
||||
xboxEnableFitness: 0
|
||||
visibleInBackground: 1
|
||||
allowFullscreenSwitch: 1
|
||||
graphicsJobMode: 0
|
||||
fullscreenMode: 1
|
||||
xboxSpeechDB: 0
|
||||
xboxEnableHeadOrientation: 0
|
||||
xboxEnableGuest: 0
|
||||
xboxEnablePIXSampling: 0
|
||||
metalFramebufferOnly: 0
|
||||
xboxOneResolution: 0
|
||||
xboxOneSResolution: 0
|
||||
xboxOneXResolution: 3
|
||||
xboxOneMonoLoggingLevel: 0
|
||||
xboxOneLoggingLevel: 1
|
||||
xboxOneDisableEsram: 0
|
||||
xboxOnePresentImmediateThreshold: 0
|
||||
switchQueueCommandMemory: 1048576
|
||||
switchQueueControlMemory: 16384
|
||||
switchQueueComputeMemory: 262144
|
||||
switchNVNShaderPoolsGranularity: 33554432
|
||||
switchNVNDefaultPoolsGranularity: 16777216
|
||||
switchNVNOtherPoolsGranularity: 16777216
|
||||
vulkanEnableSetSRGBWrite: 0
|
||||
m_SupportedAspectRatios:
|
||||
4:3: 1
|
||||
5:4: 1
|
||||
16:10: 1
|
||||
16:9: 1
|
||||
Others: 1
|
||||
bundleVersion: 1.0
|
||||
preloadedAssets: []
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
xboxOneDisableKinectGpuReservation: 1
|
||||
xboxOneEnable7thCore: 1
|
||||
vrSettings:
|
||||
cardboard:
|
||||
depthFormat: 0
|
||||
enableTransitionView: 0
|
||||
daydream:
|
||||
depthFormat: 0
|
||||
useSustainedPerformanceMode: 0
|
||||
enableVideoLayer: 0
|
||||
useProtectedVideoMemory: 0
|
||||
minimumSupportedHeadTracking: 0
|
||||
maximumSupportedHeadTracking: 1
|
||||
hololens:
|
||||
depthFormat: 1
|
||||
depthBufferSharingEnabled: 1
|
||||
lumin:
|
||||
depthFormat: 0
|
||||
frameTiming: 2
|
||||
enableGLCache: 0
|
||||
glCacheMaxBlobSize: 524288
|
||||
glCacheMaxFileSize: 8388608
|
||||
oculus:
|
||||
sharedDepthBuffer: 1
|
||||
dashSupport: 1
|
||||
lowOverheadMode: 0
|
||||
protectedContext: 0
|
||||
v2Signing: 0
|
||||
enable360StereoCapture: 0
|
||||
isWsaHolographicRemotingEnabled: 0
|
||||
protectGraphicsMemory: 0
|
||||
enableFrameTimingStats: 0
|
||||
useHDRDisplay: 0
|
||||
m_ColorGamuts: 00000000
|
||||
targetPixelDensity: 30
|
||||
resolutionScalingMode: 0
|
||||
androidSupportedAspectRatio: 1
|
||||
androidMaxAspectRatio: 2.1
|
||||
applicationIdentifier: {}
|
||||
buildNumber: {}
|
||||
AndroidBundleVersionCode: 1
|
||||
AndroidMinSdkVersion: 16
|
||||
AndroidTargetSdkVersion: 0
|
||||
AndroidPreferredInstallLocation: 1
|
||||
aotOptions:
|
||||
stripEngineCode: 1
|
||||
iPhoneStrippingLevel: 0
|
||||
iPhoneScriptCallOptimization: 0
|
||||
ForceInternetPermission: 0
|
||||
ForceSDCardPermission: 0
|
||||
CreateWallpaper: 0
|
||||
APKExpansionFiles: 0
|
||||
keepLoadedShadersAlive: 0
|
||||
StripUnusedMeshComponents: 0
|
||||
VertexChannelCompressionMask: 4054
|
||||
iPhoneSdkVersion: 988
|
||||
iOSTargetOSVersionString: 9.0
|
||||
tvOSSdkVersion: 0
|
||||
tvOSRequireExtendedGameController: 0
|
||||
tvOSTargetOSVersionString: 9.0
|
||||
uIPrerenderedIcon: 0
|
||||
uIRequiresPersistentWiFi: 0
|
||||
uIRequiresFullScreen: 1
|
||||
uIStatusBarHidden: 1
|
||||
uIExitOnSuspend: 0
|
||||
uIStatusBarStyle: 0
|
||||
iPhoneSplashScreen: {fileID: 0}
|
||||
iPhoneHighResSplashScreen: {fileID: 0}
|
||||
iPhoneTallHighResSplashScreen: {fileID: 0}
|
||||
iPhone47inSplashScreen: {fileID: 0}
|
||||
iPhone55inPortraitSplashScreen: {fileID: 0}
|
||||
iPhone55inLandscapeSplashScreen: {fileID: 0}
|
||||
iPhone58inPortraitSplashScreen: {fileID: 0}
|
||||
iPhone58inLandscapeSplashScreen: {fileID: 0}
|
||||
iPadPortraitSplashScreen: {fileID: 0}
|
||||
iPadHighResPortraitSplashScreen: {fileID: 0}
|
||||
iPadLandscapeSplashScreen: {fileID: 0}
|
||||
iPadHighResLandscapeSplashScreen: {fileID: 0}
|
||||
iPhone65inPortraitSplashScreen: {fileID: 0}
|
||||
iPhone65inLandscapeSplashScreen: {fileID: 0}
|
||||
iPhone61inPortraitSplashScreen: {fileID: 0}
|
||||
iPhone61inLandscapeSplashScreen: {fileID: 0}
|
||||
appleTVSplashScreen: {fileID: 0}
|
||||
appleTVSplashScreen2x: {fileID: 0}
|
||||
tvOSSmallIconLayers: []
|
||||
tvOSSmallIconLayers2x: []
|
||||
tvOSLargeIconLayers: []
|
||||
tvOSLargeIconLayers2x: []
|
||||
tvOSTopShelfImageLayers: []
|
||||
tvOSTopShelfImageLayers2x: []
|
||||
tvOSTopShelfImageWideLayers: []
|
||||
tvOSTopShelfImageWideLayers2x: []
|
||||
iOSLaunchScreenType: 0
|
||||
iOSLaunchScreenPortrait: {fileID: 0}
|
||||
iOSLaunchScreenLandscape: {fileID: 0}
|
||||
iOSLaunchScreenBackgroundColor:
|
||||
serializedVersion: 2
|
||||
rgba: 0
|
||||
iOSLaunchScreenFillPct: 100
|
||||
iOSLaunchScreenSize: 100
|
||||
iOSLaunchScreenCustomXibPath:
|
||||
iOSLaunchScreeniPadType: 0
|
||||
iOSLaunchScreeniPadImage: {fileID: 0}
|
||||
iOSLaunchScreeniPadBackgroundColor:
|
||||
serializedVersion: 2
|
||||
rgba: 0
|
||||
iOSLaunchScreeniPadFillPct: 100
|
||||
iOSLaunchScreeniPadSize: 100
|
||||
iOSLaunchScreeniPadCustomXibPath:
|
||||
iOSUseLaunchScreenStoryboard: 0
|
||||
iOSLaunchScreenCustomStoryboardPath:
|
||||
iOSDeviceRequirements: []
|
||||
iOSURLSchemes: []
|
||||
iOSBackgroundModes: 0
|
||||
iOSMetalForceHardShadows: 0
|
||||
metalEditorSupport: 1
|
||||
metalAPIValidation: 1
|
||||
iOSRenderExtraFrameOnPause: 0
|
||||
appleDeveloperTeamID:
|
||||
iOSManualSigningProvisioningProfileID:
|
||||
tvOSManualSigningProvisioningProfileID:
|
||||
iOSManualSigningProvisioningProfileType: 0
|
||||
tvOSManualSigningProvisioningProfileType: 0
|
||||
appleEnableAutomaticSigning: 0
|
||||
iOSRequireARKit: 0
|
||||
iOSAutomaticallyDetectAndAddCapabilities: 1
|
||||
appleEnableProMotion: 0
|
||||
clonedFromGUID: 00000000000000000000000000000000
|
||||
templatePackageId:
|
||||
templateDefaultScene:
|
||||
AndroidTargetArchitectures: 1
|
||||
AndroidSplashScreenScale: 0
|
||||
androidSplashScreen: {fileID: 0}
|
||||
AndroidKeystoreName:
|
||||
AndroidKeyaliasName:
|
||||
AndroidBuildApkPerCpuArchitecture: 0
|
||||
AndroidTVCompatibility: 0
|
||||
AndroidIsGame: 1
|
||||
AndroidEnableTango: 0
|
||||
androidEnableBanner: 1
|
||||
androidUseLowAccuracyLocation: 0
|
||||
androidUseCustomKeystore: 0
|
||||
m_AndroidBanners:
|
||||
- width: 320
|
||||
height: 180
|
||||
banner: {fileID: 0}
|
||||
androidGamepadSupportLevel: 0
|
||||
AndroidValidateAppBundleSize: 1
|
||||
AndroidAppBundleSizeToValidate: 150
|
||||
resolutionDialogBanner: {fileID: 0}
|
||||
m_BuildTargetIcons: []
|
||||
m_BuildTargetPlatformIcons: []
|
||||
m_BuildTargetBatching: []
|
||||
m_BuildTargetGraphicsAPIs: []
|
||||
m_BuildTargetVRSettings: []
|
||||
openGLRequireES31: 0
|
||||
openGLRequireES31AEP: 0
|
||||
openGLRequireES32: 0
|
||||
vuforiaEnabled: 0
|
||||
m_TemplateCustomTags: {}
|
||||
mobileMTRendering:
|
||||
Android: 1
|
||||
iPhone: 1
|
||||
tvOS: 1
|
||||
m_BuildTargetGroupLightmapEncodingQuality: []
|
||||
m_BuildTargetGroupLightmapSettings: []
|
||||
playModeTestRunnerEnabled: 0
|
||||
runPlayModeTestAsEditModeTest: 0
|
||||
actionOnDotNetUnhandledException: 1
|
||||
enableInternalProfiler: 0
|
||||
logObjCUncaughtExceptions: 1
|
||||
enableCrashReportAPI: 0
|
||||
cameraUsageDescription:
|
||||
locationUsageDescription:
|
||||
microphoneUsageDescription:
|
||||
switchNetLibKey:
|
||||
switchSocketMemoryPoolSize: 6144
|
||||
switchSocketAllocatorPoolSize: 128
|
||||
switchSocketConcurrencyLimit: 14
|
||||
switchScreenResolutionBehavior: 2
|
||||
switchUseCPUProfiler: 0
|
||||
switchApplicationID: 0x01004b9000490000
|
||||
switchNSODependencies:
|
||||
switchTitleNames_0:
|
||||
switchTitleNames_1:
|
||||
switchTitleNames_2:
|
||||
switchTitleNames_3:
|
||||
switchTitleNames_4:
|
||||
switchTitleNames_5:
|
||||
switchTitleNames_6:
|
||||
switchTitleNames_7:
|
||||
switchTitleNames_8:
|
||||
switchTitleNames_9:
|
||||
switchTitleNames_10:
|
||||
switchTitleNames_11:
|
||||
switchTitleNames_12:
|
||||
switchTitleNames_13:
|
||||
switchTitleNames_14:
|
||||
switchPublisherNames_0:
|
||||
switchPublisherNames_1:
|
||||
switchPublisherNames_2:
|
||||
switchPublisherNames_3:
|
||||
switchPublisherNames_4:
|
||||
switchPublisherNames_5:
|
||||
switchPublisherNames_6:
|
||||
switchPublisherNames_7:
|
||||
switchPublisherNames_8:
|
||||
switchPublisherNames_9:
|
||||
switchPublisherNames_10:
|
||||
switchPublisherNames_11:
|
||||
switchPublisherNames_12:
|
||||
switchPublisherNames_13:
|
||||
switchPublisherNames_14:
|
||||
switchIcons_0: {fileID: 0}
|
||||
switchIcons_1: {fileID: 0}
|
||||
switchIcons_2: {fileID: 0}
|
||||
switchIcons_3: {fileID: 0}
|
||||
switchIcons_4: {fileID: 0}
|
||||
switchIcons_5: {fileID: 0}
|
||||
switchIcons_6: {fileID: 0}
|
||||
switchIcons_7: {fileID: 0}
|
||||
switchIcons_8: {fileID: 0}
|
||||
switchIcons_9: {fileID: 0}
|
||||
switchIcons_10: {fileID: 0}
|
||||
switchIcons_11: {fileID: 0}
|
||||
switchIcons_12: {fileID: 0}
|
||||
switchIcons_13: {fileID: 0}
|
||||
switchIcons_14: {fileID: 0}
|
||||
switchSmallIcons_0: {fileID: 0}
|
||||
switchSmallIcons_1: {fileID: 0}
|
||||
switchSmallIcons_2: {fileID: 0}
|
||||
switchSmallIcons_3: {fileID: 0}
|
||||
switchSmallIcons_4: {fileID: 0}
|
||||
switchSmallIcons_5: {fileID: 0}
|
||||
switchSmallIcons_6: {fileID: 0}
|
||||
switchSmallIcons_7: {fileID: 0}
|
||||
switchSmallIcons_8: {fileID: 0}
|
||||
switchSmallIcons_9: {fileID: 0}
|
||||
switchSmallIcons_10: {fileID: 0}
|
||||
switchSmallIcons_11: {fileID: 0}
|
||||
switchSmallIcons_12: {fileID: 0}
|
||||
switchSmallIcons_13: {fileID: 0}
|
||||
switchSmallIcons_14: {fileID: 0}
|
||||
switchManualHTML:
|
||||
switchAccessibleURLs:
|
||||
switchLegalInformation:
|
||||
switchMainThreadStackSize: 1048576
|
||||
switchPresenceGroupId:
|
||||
switchLogoHandling: 0
|
||||
switchReleaseVersion: 0
|
||||
switchDisplayVersion: 1.0.0
|
||||
switchStartupUserAccount: 0
|
||||
switchTouchScreenUsage: 0
|
||||
switchSupportedLanguagesMask: 0
|
||||
switchLogoType: 0
|
||||
switchApplicationErrorCodeCategory:
|
||||
switchUserAccountSaveDataSize: 0
|
||||
switchUserAccountSaveDataJournalSize: 0
|
||||
switchApplicationAttribute: 0
|
||||
switchCardSpecSize: -1
|
||||
switchCardSpecClock: -1
|
||||
switchRatingsMask: 0
|
||||
switchRatingsInt_0: 0
|
||||
switchRatingsInt_1: 0
|
||||
switchRatingsInt_2: 0
|
||||
switchRatingsInt_3: 0
|
||||
switchRatingsInt_4: 0
|
||||
switchRatingsInt_5: 0
|
||||
switchRatingsInt_6: 0
|
||||
switchRatingsInt_7: 0
|
||||
switchRatingsInt_8: 0
|
||||
switchRatingsInt_9: 0
|
||||
switchRatingsInt_10: 0
|
||||
switchRatingsInt_11: 0
|
||||
switchLocalCommunicationIds_0:
|
||||
switchLocalCommunicationIds_1:
|
||||
switchLocalCommunicationIds_2:
|
||||
switchLocalCommunicationIds_3:
|
||||
switchLocalCommunicationIds_4:
|
||||
switchLocalCommunicationIds_5:
|
||||
switchLocalCommunicationIds_6:
|
||||
switchLocalCommunicationIds_7:
|
||||
switchParentalControl: 0
|
||||
switchAllowsScreenshot: 1
|
||||
switchAllowsVideoCapturing: 1
|
||||
switchAllowsRuntimeAddOnContentInstall: 0
|
||||
switchDataLossConfirmation: 0
|
||||
switchUserAccountLockEnabled: 0
|
||||
switchSystemResourceMemory: 16777216
|
||||
switchSupportedNpadStyles: 6
|
||||
switchNativeFsCacheSize: 32
|
||||
switchIsHoldTypeHorizontal: 0
|
||||
switchSupportedNpadCount: 8
|
||||
switchSocketConfigEnabled: 0
|
||||
switchTcpInitialSendBufferSize: 32
|
||||
switchTcpInitialReceiveBufferSize: 64
|
||||
switchTcpAutoSendBufferSizeMax: 256
|
||||
switchTcpAutoReceiveBufferSizeMax: 256
|
||||
switchUdpSendBufferSize: 9
|
||||
switchUdpReceiveBufferSize: 42
|
||||
switchSocketBufferEfficiency: 4
|
||||
switchSocketInitializeEnabled: 1
|
||||
switchNetworkInterfaceManagerInitializeEnabled: 1
|
||||
switchPlayerConnectionEnabled: 1
|
||||
ps4NPAgeRating: 12
|
||||
ps4NPTitleSecret:
|
||||
ps4NPTrophyPackPath:
|
||||
ps4ParentalLevel: 11
|
||||
ps4ContentID: ED1633-NPXX51362_00-0000000000000000
|
||||
ps4Category: 0
|
||||
ps4MasterVersion: 01.00
|
||||
ps4AppVersion: 01.00
|
||||
ps4AppType: 0
|
||||
ps4ParamSfxPath:
|
||||
ps4VideoOutPixelFormat: 0
|
||||
ps4VideoOutInitialWidth: 1920
|
||||
ps4VideoOutBaseModeInitialWidth: 1920
|
||||
ps4VideoOutReprojectionRate: 60
|
||||
ps4PronunciationXMLPath:
|
||||
ps4PronunciationSIGPath:
|
||||
ps4BackgroundImagePath:
|
||||
ps4StartupImagePath:
|
||||
ps4StartupImagesFolder:
|
||||
ps4IconImagesFolder:
|
||||
ps4SaveDataImagePath:
|
||||
ps4SdkOverride:
|
||||
ps4BGMPath:
|
||||
ps4ShareFilePath:
|
||||
ps4ShareOverlayImagePath:
|
||||
ps4PrivacyGuardImagePath:
|
||||
ps4NPtitleDatPath:
|
||||
ps4RemotePlayKeyAssignment: -1
|
||||
ps4RemotePlayKeyMappingDir:
|
||||
ps4PlayTogetherPlayerCount: 0
|
||||
ps4EnterButtonAssignment: 2
|
||||
ps4ApplicationParam1: 0
|
||||
ps4ApplicationParam2: 0
|
||||
ps4ApplicationParam3: 0
|
||||
ps4ApplicationParam4: 0
|
||||
ps4DownloadDataSize: 0
|
||||
ps4GarlicHeapSize: 2048
|
||||
ps4ProGarlicHeapSize: 2560
|
||||
playerPrefsMaxSize: 32768
|
||||
ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
|
||||
ps4pnSessions: 1
|
||||
ps4pnPresence: 1
|
||||
ps4pnFriends: 1
|
||||
ps4pnGameCustomData: 1
|
||||
playerPrefsSupport: 0
|
||||
enableApplicationExit: 0
|
||||
resetTempFolder: 1
|
||||
restrictedAudioUsageRights: 0
|
||||
ps4UseResolutionFallback: 0
|
||||
ps4ReprojectionSupport: 0
|
||||
ps4UseAudio3dBackend: 0
|
||||
ps4SocialScreenEnabled: 0
|
||||
ps4ScriptOptimizationLevel: 2
|
||||
ps4Audio3dVirtualSpeakerCount: 14
|
||||
ps4attribCpuUsage: 0
|
||||
ps4PatchPkgPath:
|
||||
ps4PatchLatestPkgPath:
|
||||
ps4PatchChangeinfoPath:
|
||||
ps4PatchDayOne: 0
|
||||
ps4attribUserManagement: 0
|
||||
ps4attribMoveSupport: 0
|
||||
ps4attrib3DSupport: 0
|
||||
ps4attribShareSupport: 0
|
||||
ps4attribExclusiveVR: 0
|
||||
ps4disableAutoHideSplash: 0
|
||||
ps4videoRecordingFeaturesUsed: 0
|
||||
ps4contentSearchFeaturesUsed: 0
|
||||
ps4attribEyeToEyeDistanceSettingVR: 0
|
||||
ps4IncludedModules: []
|
||||
monoEnv:
|
||||
splashScreenBackgroundSourceLandscape: {fileID: 0}
|
||||
splashScreenBackgroundSourcePortrait: {fileID: 0}
|
||||
blurSplashScreenBackground: 1
|
||||
spritePackerPolicy:
|
||||
webGLMemorySize: 32
|
||||
webGLExceptionSupport: 1
|
||||
webGLNameFilesAsHashes: 0
|
||||
webGLDataCaching: 1
|
||||
webGLDebugSymbols: 0
|
||||
webGLEmscriptenArgs:
|
||||
webGLModulesDirectory:
|
||||
webGLTemplate: APPLICATION:Default
|
||||
webGLAnalyzeBuildSize: 0
|
||||
webGLUseEmbeddedResources: 0
|
||||
webGLCompressionFormat: 0
|
||||
webGLLinkerTarget: 1
|
||||
webGLThreadsSupport: 0
|
||||
webGLWasmStreaming: 0
|
||||
scriptingDefineSymbols: {}
|
||||
platformArchitecture: {}
|
||||
scriptingBackend:
|
||||
Standalone: 1
|
||||
il2cppCompilerConfiguration: {}
|
||||
managedStrippingLevel: {}
|
||||
incrementalIl2cppBuild: {}
|
||||
allowUnsafeCode: 0
|
||||
additionalIl2CppArgs:
|
||||
scriptingRuntimeVersion: 1
|
||||
gcIncremental: 0
|
||||
gcWBarrierValidation: 0
|
||||
apiCompatibilityLevelPerPlatform: {}
|
||||
m_RenderingPath: 1
|
||||
m_MobileRenderingPath: 1
|
||||
metroPackageName: test-standalone-scripts
|
||||
metroPackageVersion:
|
||||
metroCertificatePath:
|
||||
metroCertificatePassword:
|
||||
metroCertificateSubject:
|
||||
metroCertificateIssuer:
|
||||
metroCertificateNotAfter: 0000000000000000
|
||||
metroApplicationDescription: test-standalone-scripts
|
||||
wsaImages: {}
|
||||
metroTileShortName:
|
||||
metroTileShowName: 0
|
||||
metroMediumTileShowName: 0
|
||||
metroLargeTileShowName: 0
|
||||
metroWideTileShowName: 0
|
||||
metroSupportStreamingInstall: 0
|
||||
metroLastRequiredScene: 0
|
||||
metroDefaultTileSize: 1
|
||||
metroTileForegroundText: 2
|
||||
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
|
||||
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628,
|
||||
a: 1}
|
||||
metroSplashScreenUseBackgroundColor: 0
|
||||
platformCapabilities: {}
|
||||
metroTargetDeviceFamilies: {}
|
||||
metroFTAName:
|
||||
metroFTAFileTypes: []
|
||||
metroProtocolName:
|
||||
XboxOneProductId:
|
||||
XboxOneUpdateKey:
|
||||
XboxOneSandboxId:
|
||||
XboxOneContentId:
|
||||
XboxOneTitleId:
|
||||
XboxOneSCId:
|
||||
XboxOneGameOsOverridePath:
|
||||
XboxOnePackagingOverridePath:
|
||||
XboxOneAppManifestOverridePath:
|
||||
XboxOneVersion: 1.0.0.0
|
||||
XboxOnePackageEncryption: 0
|
||||
XboxOnePackageUpdateGranularity: 2
|
||||
XboxOneDescription:
|
||||
XboxOneLanguage:
|
||||
- enus
|
||||
XboxOneCapability: []
|
||||
XboxOneGameRating: {}
|
||||
XboxOneIsContentPackage: 0
|
||||
XboxOneEnableGPUVariability: 1
|
||||
XboxOneSockets: {}
|
||||
XboxOneSplashScreen: {fileID: 0}
|
||||
XboxOneAllowedProductIds: []
|
||||
XboxOnePersistentLocalStorageSize: 0
|
||||
XboxOneXTitleMemory: 8
|
||||
xboxOneScriptCompiler: 1
|
||||
XboxOneOverrideIdentityName:
|
||||
vrEditorSettings:
|
||||
daydream:
|
||||
daydreamIconForeground: {fileID: 0}
|
||||
daydreamIconBackground: {fileID: 0}
|
||||
cloudServicesEnabled: {}
|
||||
luminIcon:
|
||||
m_Name:
|
||||
m_ModelFolderPath:
|
||||
m_PortalFolderPath:
|
||||
luminCert:
|
||||
m_CertPath:
|
||||
m_SignPackage: 1
|
||||
luminIsChannelApp: 0
|
||||
luminVersion:
|
||||
m_VersionCode: 1
|
||||
m_VersionName:
|
||||
facebookSdkVersion:
|
||||
facebookAppId:
|
||||
facebookCookies: 1
|
||||
facebookLogging: 1
|
||||
facebookStatus: 1
|
||||
facebookXfbml: 0
|
||||
facebookFrictionlessRequests: 1
|
||||
apiCompatibilityLevel: 6
|
||||
cloudProjectId:
|
||||
framebufferDepthMemorylessMode: 0
|
||||
projectName:
|
||||
organizationId:
|
||||
cloudEnabled: 0
|
||||
enableNativePlatformBackendsForNewInputSystem: 0
|
||||
disableOldInputManagerSupport: 0
|
||||
legacyClampBlendShapeWeights: 0
|
||||
2
dist/test-standalone-scripts/ProjectSettings/ProjectVersion.txt
vendored
Normal file
2
dist/test-standalone-scripts/ProjectSettings/ProjectVersion.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
m_EditorVersion: 2019.2.11f1
|
||||
m_EditorVersionWithRevision: 2019.2.11f1 (5f859a4cfee5)
|
||||
BIN
dist/test-standalone-scripts/ProjectSettings/QualitySettings.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/QualitySettings.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/TagManager.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/TagManager.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/TimeManager.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/TimeManager.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/UnityConnectSettings.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/UnityConnectSettings.asset
vendored
Normal file
Binary file not shown.
BIN
dist/test-standalone-scripts/ProjectSettings/VFXManager.asset
vendored
Normal file
BIN
dist/test-standalone-scripts/ProjectSettings/VFXManager.asset
vendored
Normal file
Binary file not shown.
10
dist/test-standalone-scripts/ProjectSettings/XRSettings.asset
vendored
Normal file
10
dist/test-standalone-scripts/ProjectSettings/XRSettings.asset
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"m_SettingKeys": [
|
||||
"VR Device Disabled",
|
||||
"VR Device User Alert"
|
||||
],
|
||||
"m_SettingValues": [
|
||||
"False",
|
||||
"False"
|
||||
]
|
||||
}
|
||||
7
dist/unity-config/services-config.json.template
vendored
Normal file
7
dist/unity-config/services-config.json.template
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"licensingServiceBaseUrl": "%URL%",
|
||||
"enableEntitlementLicensing": true,
|
||||
"enableFloatingApi": true,
|
||||
"clientConnectTimeoutSec": 5,
|
||||
"clientHandshakeTimeoutSec": 10
|
||||
}
|
||||
@@ -8,14 +8,14 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"prebuild": "yarn",
|
||||
"build": "tsc && ncc build lib --source-map --license licenses.txt",
|
||||
"lint": "prettier --check \"src/**/*.{js,ts}\" && eslint src/**/*.ts",
|
||||
"build": "tsc && ncc build lib/index.js --source-map --license licenses.txt",
|
||||
"lint": "prettier --check \"src/**/*.{js,ts}\" && eslint src --ext .js,.ts --max-warnings=0",
|
||||
"format": "prettier --write \"src/**/*.{js,ts}\"",
|
||||
"test": "jest",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/github": "^5.0.0",
|
||||
"@octokit/openapi-types": "^11.2.0",
|
||||
|
||||
78
src/index.ts
78
src/index.ts
@@ -1,58 +1,30 @@
|
||||
import * as core from '@actions/core';
|
||||
import { Action, Docker, ImageTag, Input, Output, ResultsCheck } from './model';
|
||||
import { run as main } from './main';
|
||||
import path from 'path';
|
||||
import { run as post } from './post';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
Action.checkCompatibility();
|
||||
/*
|
||||
* GitHub Action can provide multiple executable entrypoints (pre, main, post),
|
||||
* but it is complicated process to generate multiple `.js` files with `ncc`.
|
||||
* So we rather generate just one entrypoint, that is symlinked to multiple locations (main.js and post.js).
|
||||
* Then when GitHub Action Runner executes it as `node path/to/main.js` and `node path/to/post.js`,
|
||||
* it can read arguments it was executed with and decide which file to execute.
|
||||
* The argv[0] is going to be a full path to `node` executable and
|
||||
* the argv[1] is going to be the full path to the script.
|
||||
* In case index.js would be marked executable and executed directly without the argv[1] it defaults to "main.js".
|
||||
*/
|
||||
async function run([, name = 'main.js']: string[]) {
|
||||
const script = path.basename(name);
|
||||
|
||||
const { workspace, actionFolder } = Action;
|
||||
const {
|
||||
editorVersion,
|
||||
customImage,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
coverageOptions,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
sshAgent,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
checkName,
|
||||
} = Input.getFromUser();
|
||||
const baseImage = new ImageTag({ editorVersion, customImage });
|
||||
const runnerTemporaryPath = process.env.RUNNER_TEMP;
|
||||
|
||||
try {
|
||||
await Docker.run(baseImage, {
|
||||
actionFolder,
|
||||
editorVersion,
|
||||
workspace,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
coverageOptions,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
sshAgent,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
runnerTemporaryPath,
|
||||
});
|
||||
} finally {
|
||||
await Output.setArtifactsPath(artifactsPath);
|
||||
await Output.setCoveragePath('CodeCoverage');
|
||||
}
|
||||
|
||||
if (githubToken) {
|
||||
const failedTestCount = await ResultsCheck.createCheck(artifactsPath, githubToken, checkName);
|
||||
if (failedTestCount >= 1) {
|
||||
core.setFailed(`Test(s) Failed! Check '${checkName}' for details.`);
|
||||
}
|
||||
}
|
||||
} catch (error: any) {
|
||||
core.setFailed(error.message);
|
||||
switch (script) {
|
||||
case 'main.js':
|
||||
await main();
|
||||
break;
|
||||
case 'post.js':
|
||||
await post();
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown script argument: '${script}'`);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
run(process.argv);
|
||||
|
||||
64
src/main.ts
Normal file
64
src/main.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import * as core from '@actions/core';
|
||||
import { Action, Docker, ImageTag, Input, Output, ResultsCheck } from './model';
|
||||
|
||||
export async function run() {
|
||||
try {
|
||||
Action.checkCompatibility();
|
||||
|
||||
const { workspace, actionFolder } = Action;
|
||||
const {
|
||||
editorVersion,
|
||||
customImage,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
coverageOptions,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
sshAgent,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
checkName,
|
||||
packageMode,
|
||||
packageName,
|
||||
chownFilesTo,
|
||||
unityLicensingServer,
|
||||
} = Input.getFromUser();
|
||||
const baseImage = new ImageTag({ editorVersion, customImage });
|
||||
const runnerContext = Action.runnerContext();
|
||||
|
||||
try {
|
||||
await Docker.run(baseImage, {
|
||||
actionFolder,
|
||||
editorVersion,
|
||||
workspace,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
coverageOptions,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
sshAgent,
|
||||
packageMode,
|
||||
packageName,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
chownFilesTo,
|
||||
unityLicensingServer,
|
||||
...runnerContext,
|
||||
});
|
||||
} finally {
|
||||
await Output.setArtifactsPath(artifactsPath);
|
||||
await Output.setCoveragePath('CodeCoverage');
|
||||
}
|
||||
|
||||
if (githubToken) {
|
||||
const failedTestCount = await ResultsCheck.createCheck(artifactsPath, githubToken, checkName);
|
||||
if (failedTestCount >= 1) {
|
||||
core.setFailed(`Test(s) Failed! Check '${checkName}' for details.`);
|
||||
}
|
||||
}
|
||||
} catch (error: any) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import path from 'path';
|
||||
|
||||
describe('Action', () => {
|
||||
describe('compatibility check', () => {
|
||||
it('throws for anything other than linux', () => {
|
||||
if (process.platform !== 'linux') {
|
||||
it('throws for anything other than linux or windows', () => {
|
||||
if (process.platform !== 'linux' && process.platform !== 'win32') {
|
||||
expect(() => Action.checkCompatibility()).toThrow();
|
||||
} else {
|
||||
expect(() => Action.checkCompatibility()).not.toThrow();
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import path from 'path';
|
||||
|
||||
export interface RunnerContext {
|
||||
runnerTemporaryPath: string;
|
||||
githubAction: string;
|
||||
}
|
||||
|
||||
const Action = {
|
||||
get supportedPlatforms() {
|
||||
return ['linux'];
|
||||
return ['linux', 'win32'];
|
||||
},
|
||||
|
||||
get isRunningLocally() {
|
||||
@@ -33,6 +38,16 @@ const Action = {
|
||||
return process.env.GITHUB_WORKSPACE;
|
||||
},
|
||||
|
||||
runnerContext(): RunnerContext {
|
||||
const runnerTemporaryPath = process.env.RUNNER_TEMP ?? process.cwd();
|
||||
const githubAction = process.env.GITHUB_ACTION ?? process.pid.toString();
|
||||
|
||||
return {
|
||||
runnerTemporaryPath,
|
||||
githubAction,
|
||||
};
|
||||
},
|
||||
|
||||
checkCompatibility() {
|
||||
const currentPlatform = process.platform;
|
||||
if (!Action.supportedPlatforms.includes(currentPlatform)) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import Docker from './docker';
|
||||
|
||||
describe('Docker', () => {
|
||||
it.skip('runs', async () => {
|
||||
const image = 'unity-builder:2019.2.11f1-webgl';
|
||||
const image = 'unity-builder:2022.3.7f1-webgl';
|
||||
const parameters = {
|
||||
workspace: Action.rootFolder,
|
||||
projectPath: `${Action.rootFolder}/test-project`,
|
||||
|
||||
@@ -1,9 +1,56 @@
|
||||
import { existsSync, mkdirSync } from 'fs';
|
||||
import { existsSync, mkdirSync, readFileSync, rmSync } from 'fs';
|
||||
import LicensingServerSetup from './licensing-server-setup';
|
||||
import type { RunnerContext } from './action';
|
||||
import { exec } from '@actions/exec';
|
||||
import path from 'path';
|
||||
|
||||
/**
|
||||
* Build a path for a docker --cidfile parameter. Docker will store the the created container.
|
||||
* This path is stable for the whole execution of the action, so it can be executed with the same parameters
|
||||
* multiple times and get the same result.
|
||||
*/
|
||||
const containerIdFilePath = parameters => {
|
||||
const { runnerTemporaryPath, githubAction } = parameters;
|
||||
|
||||
return path.join(runnerTemporaryPath, `container_${githubAction}`);
|
||||
};
|
||||
|
||||
const Docker = {
|
||||
/**
|
||||
* Remove a possible leftover container created by `Docker.run`.
|
||||
*/
|
||||
async ensureContainerRemoval(parameters: RunnerContext) {
|
||||
const cidfile = containerIdFilePath(parameters);
|
||||
if (!existsSync(cidfile)) {
|
||||
return;
|
||||
}
|
||||
const container = readFileSync(cidfile, 'ascii').trim();
|
||||
await exec(`docker`, ['rm', '--force', '--volumes', container], { silent: true });
|
||||
rmSync(cidfile);
|
||||
},
|
||||
|
||||
async run(image, parameters, silent = false) {
|
||||
let runCommand = '';
|
||||
|
||||
if (parameters.unityLicensingServer !== '') {
|
||||
LicensingServerSetup.Setup(parameters.unityLicensingServer, parameters.actionFolder);
|
||||
}
|
||||
|
||||
switch (process.platform) {
|
||||
case 'linux':
|
||||
runCommand = this.getLinuxCommand(image, parameters);
|
||||
break;
|
||||
case 'win32':
|
||||
runCommand = this.getWindowsCommand(image, parameters);
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Operation system, ${process.platform}, is not supported yet.`);
|
||||
}
|
||||
|
||||
await exec(runCommand, undefined, { silent });
|
||||
},
|
||||
|
||||
getLinuxCommand(image, parameters): string {
|
||||
const {
|
||||
actionFolder,
|
||||
editorVersion,
|
||||
@@ -15,64 +62,161 @@ const Docker = {
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
sshAgent,
|
||||
packageMode,
|
||||
packageName,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
runnerTemporaryPath,
|
||||
chownFilesTo,
|
||||
unityLicensingServer,
|
||||
} = parameters;
|
||||
|
||||
const githubHome = path.join(runnerTemporaryPath, '_github_home');
|
||||
if (!existsSync(githubHome)) mkdirSync(githubHome);
|
||||
const githubWorkflow = path.join(runnerTemporaryPath, '_github_workflow');
|
||||
if (!existsSync(githubWorkflow)) mkdirSync(githubWorkflow);
|
||||
const cidfile = containerIdFilePath(parameters);
|
||||
const testPlatforms = (
|
||||
testMode === 'all' ? ['playmode', 'editmode', 'COMBINE_RESULTS'] : [testMode]
|
||||
).join(';');
|
||||
|
||||
const command = `docker run \
|
||||
--workdir /github/workspace \
|
||||
--rm \
|
||||
--env UNITY_LICENSE \
|
||||
--env UNITY_LICENSE_FILE \
|
||||
--env UNITY_EMAIL \
|
||||
--env UNITY_PASSWORD \
|
||||
--env UNITY_SERIAL \
|
||||
--env UNITY_VERSION="${editorVersion}" \
|
||||
--env PROJECT_PATH="${projectPath}" \
|
||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||
--env TEST_PLATFORMS="${testPlatforms}" \
|
||||
--env COVERAGE_OPTIONS="${coverageOptions}" \
|
||||
--env COVERAGE_RESULTS_PATH="CodeCoverage" \
|
||||
--env ARTIFACTS_PATH="${artifactsPath}" \
|
||||
--env GITHUB_REF \
|
||||
--env GITHUB_SHA \
|
||||
--env GITHUB_REPOSITORY \
|
||||
--env GITHUB_ACTOR \
|
||||
--env GITHUB_WORKFLOW \
|
||||
--env GITHUB_HEAD_REF \
|
||||
--env GITHUB_BASE_REF \
|
||||
--env GITHUB_EVENT_NAME \
|
||||
--env GITHUB_WORKSPACE=/github/workspace \
|
||||
--env GITHUB_ACTION \
|
||||
--env GITHUB_EVENT_PATH \
|
||||
--env RUNNER_OS \
|
||||
--env RUNNER_TOOL_CACHE \
|
||||
--env RUNNER_TEMP \
|
||||
--env RUNNER_WORKSPACE \
|
||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||
--volume "${githubHome}":"/root:z" \
|
||||
--volume "${githubWorkflow}":"/github/workflow:z" \
|
||||
--volume "${workspace}":"/github/workspace:z" \
|
||||
--volume "${actionFolder}/steps":"/steps:z" \
|
||||
--volume "${actionFolder}/entrypoint.sh":"/entrypoint.sh:z" \
|
||||
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
|
||||
${useHostNetwork ? '--net=host' : ''} \
|
||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||
${image} \
|
||||
/bin/bash /entrypoint.sh`;
|
||||
return `docker run \
|
||||
--workdir /github/workspace \
|
||||
--cidfile "${cidfile}" \
|
||||
--rm \
|
||||
--env UNITY_LICENSE \
|
||||
--env UNITY_LICENSE_FILE \
|
||||
--env UNITY_EMAIL \
|
||||
--env UNITY_PASSWORD \
|
||||
--env UNITY_SERIAL \
|
||||
--env UNITY_LICENSING_SERVER="${unityLicensingServer}" \
|
||||
--env UNITY_VERSION="${editorVersion}" \
|
||||
--env PROJECT_PATH="${projectPath}" \
|
||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||
--env TEST_PLATFORMS="${testPlatforms}" \
|
||||
--env COVERAGE_OPTIONS="${coverageOptions}" \
|
||||
--env COVERAGE_RESULTS_PATH="CodeCoverage" \
|
||||
--env ARTIFACTS_PATH="${artifactsPath}" \
|
||||
--env PACKAGE_MODE="${packageMode}" \
|
||||
--env PACKAGE_NAME="${packageName}" \
|
||||
--env GITHUB_REF \
|
||||
--env GITHUB_SHA \
|
||||
--env GITHUB_REPOSITORY \
|
||||
--env GITHUB_ACTOR \
|
||||
--env GITHUB_WORKFLOW \
|
||||
--env GITHUB_HEAD_REF \
|
||||
--env GITHUB_BASE_REF \
|
||||
--env GITHUB_EVENT_NAME \
|
||||
--env GITHUB_WORKSPACE="/github/workspace" \
|
||||
--env GITHUB_ACTION \
|
||||
--env GITHUB_EVENT_PATH \
|
||||
--env RUNNER_OS \
|
||||
--env RUNNER_TOOL_CACHE \
|
||||
--env RUNNER_TEMP \
|
||||
--env RUNNER_WORKSPACE \
|
||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||
--volume "${githubHome}:/root:z" \
|
||||
--volume "${githubWorkflow}:/github/workflow:z" \
|
||||
--volume "${workspace}:/github/workspace:z" \
|
||||
--volume "${actionFolder}/test-standalone-scripts:/UnityStandaloneScripts:z" \
|
||||
--volume "${actionFolder}/steps:/steps:z" \
|
||||
--volume "${actionFolder}/entrypoint.sh:/entrypoint.sh:z" \
|
||||
--volume "${actionFolder}/unity-config:/usr/share/unity3d/config/:z" \
|
||||
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||
${
|
||||
sshAgent ? `--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro` : ''
|
||||
} \
|
||||
${useHostNetwork ? '--net=host' : ''} \
|
||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||
${image} \
|
||||
/bin/bash -c /entrypoint.sh`;
|
||||
},
|
||||
|
||||
await exec(command, undefined, { silent });
|
||||
getWindowsCommand(image, parameters): string {
|
||||
const {
|
||||
actionFolder,
|
||||
editorVersion,
|
||||
workspace,
|
||||
projectPath,
|
||||
customParameters,
|
||||
testMode,
|
||||
coverageOptions,
|
||||
artifactsPath,
|
||||
useHostNetwork,
|
||||
sshAgent,
|
||||
packageMode,
|
||||
packageName,
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
runnerTemporaryPath,
|
||||
chownFilesTo,
|
||||
unityLicensingServer,
|
||||
} = parameters;
|
||||
|
||||
const githubHome = path.join(runnerTemporaryPath, '_github_home');
|
||||
if (!existsSync(githubHome)) mkdirSync(githubHome);
|
||||
const cidfile = containerIdFilePath(parameters);
|
||||
const githubWorkflow = path.join(runnerTemporaryPath, '_github_workflow');
|
||||
if (!existsSync(githubWorkflow)) mkdirSync(githubWorkflow);
|
||||
const testPlatforms = (
|
||||
testMode === 'all' ? ['playmode', 'editmode', 'COMBINE_RESULTS'] : [testMode]
|
||||
).join(';');
|
||||
|
||||
return `docker run \
|
||||
--workdir /github/workspace \
|
||||
--cidfile "${cidfile}" \
|
||||
--rm \
|
||||
--env UNITY_LICENSE \
|
||||
--env UNITY_LICENSE_FILE \
|
||||
--env UNITY_EMAIL \
|
||||
--env UNITY_PASSWORD \
|
||||
--env UNITY_SERIAL \
|
||||
--env UNITY_LICENSING_SERVER="${unityLicensingServer}" \
|
||||
--env UNITY_VERSION="${editorVersion}" \
|
||||
--env PROJECT_PATH="${projectPath}" \
|
||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||
--env TEST_PLATFORMS="${testPlatforms}" \
|
||||
--env COVERAGE_OPTIONS="${coverageOptions}" \
|
||||
--env COVERAGE_RESULTS_PATH="CodeCoverage" \
|
||||
--env ARTIFACTS_PATH="${artifactsPath}" \
|
||||
--env PACKAGE_MODE="${packageMode}" \
|
||||
--env PACKAGE_NAME="${packageName}" \
|
||||
--env GITHUB_REF \
|
||||
--env GITHUB_SHA \
|
||||
--env GITHUB_REPOSITORY \
|
||||
--env GITHUB_ACTOR \
|
||||
--env GITHUB_WORKFLOW \
|
||||
--env GITHUB_HEAD_REF \
|
||||
--env GITHUB_BASE_REF \
|
||||
--env GITHUB_EVENT_NAME \
|
||||
--env GITHUB_WORKSPACE="/github/workspace" \
|
||||
--env GITHUB_ACTION \
|
||||
--env GITHUB_EVENT_PATH \
|
||||
--env RUNNER_OS \
|
||||
--env RUNNER_TOOL_CACHE \
|
||||
--env RUNNER_TEMP \
|
||||
--env RUNNER_WORKSPACE \
|
||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||
${sshAgent ? '--env SSH_AUTH_SOCK=c:/ssh-agent' : ''} \
|
||||
--volume "${actionFolder}/test-standalone-scripts":"c:/UnityStandaloneScripts" \
|
||||
--volume "${githubHome}":"c:/root" \
|
||||
--volume "${githubWorkflow}":"c:/github/workflow" \
|
||||
--volume "${workspace}":"c:/github/workspace" \
|
||||
--volume "${actionFolder}/steps":"c:/steps" \
|
||||
--volume "${actionFolder}":"c:/dist" \
|
||||
${sshAgent ? `--volume ${sshAgent}:c:/ssh-agent` : ''} \
|
||||
${
|
||||
sshAgent
|
||||
? `--volume c:/Users/Administrator/.ssh/known_hosts:c:/root/.ssh/known_hosts`
|
||||
: ''
|
||||
} \
|
||||
${useHostNetwork ? '--net=host' : ''} \
|
||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||
${image} \
|
||||
powershell c:/dist/entrypoint.ps1`;
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ describe('ImageTag', () => {
|
||||
targetPlatform: some.targetPlatform,
|
||||
});
|
||||
|
||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2099.1.1111-1`);
|
||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2099.1.1111-2`);
|
||||
});
|
||||
it('returns customImage if given', () => {
|
||||
const image = new ImageTag({
|
||||
@@ -63,15 +63,15 @@ describe('ImageTag', () => {
|
||||
});
|
||||
|
||||
it('returns the specific build platform', () => {
|
||||
const image = new ImageTag({ editorVersion: '2019.2.11f1', targetPlatform: 'WebGL' });
|
||||
const image = new ImageTag({ editorVersion: '2022.3.7f1', targetPlatform: 'WebGL' });
|
||||
|
||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-webgl-1`);
|
||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2022.3.7f1-webgl-2`);
|
||||
});
|
||||
|
||||
it('returns no specific build platform for generic targetPlatforms', () => {
|
||||
const image = new ImageTag({ targetPlatform: 'NoTarget' });
|
||||
|
||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-1`);
|
||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2022.3.7f1-2`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,8 +12,8 @@ class ImageTag {
|
||||
|
||||
constructor(imageProperties) {
|
||||
const {
|
||||
editorVersion = '2019.2.11f1',
|
||||
targetPlatform = Platform.types.StandaloneLinux64,
|
||||
editorVersion = '2022.3.7f1',
|
||||
targetPlatform = ImageTag.getImagePlatformType(process.platform),
|
||||
customImage,
|
||||
} = imageProperties;
|
||||
|
||||
@@ -31,7 +31,7 @@ class ImageTag {
|
||||
this.targetPlatform = targetPlatform;
|
||||
this.targetPlatformSuffix = ImageTag.getTargetPlatformSuffix(targetPlatform, editorVersion);
|
||||
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefix(process.platform);
|
||||
this.imageRollingVersion = 1;
|
||||
this.imageRollingVersion = 2;
|
||||
}
|
||||
|
||||
static get versionPattern() {
|
||||
@@ -43,7 +43,7 @@ class ImageTag {
|
||||
generic: '',
|
||||
webgl: 'webgl',
|
||||
mac: 'mac-mono',
|
||||
windows: 'windows-mono',
|
||||
windows: 'windows-il2cpp',
|
||||
linux: 'base',
|
||||
linuxIl2cpp: 'linux-il2cpp',
|
||||
android: 'android',
|
||||
@@ -56,8 +56,25 @@ class ImageTag {
|
||||
switch (platform) {
|
||||
case 'linux':
|
||||
return 'ubuntu';
|
||||
case 'win32':
|
||||
return 'windows';
|
||||
default:
|
||||
throw new Error('The Operating System of this runner is not yet supported.');
|
||||
throw new Error(
|
||||
`The Operating System of this runner, "${platform}", is not yet supported.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static getImagePlatformType(platform) {
|
||||
switch (platform) {
|
||||
case 'linux':
|
||||
return Platform.types.StandaloneLinux64;
|
||||
case 'win32':
|
||||
return Platform.types.StandaloneWindows;
|
||||
default:
|
||||
throw new Error(
|
||||
`The Operating System of this runner, "${platform}", is not yet supported.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import Input from './input';
|
||||
import fs from 'fs';
|
||||
|
||||
jest.mock('./unity-version-parser');
|
||||
|
||||
const mockedFsExistsSync = jest.spyOn(fs, 'existsSync');
|
||||
const mockedFsReadFileSync = jest.spyOn(fs, 'readFileSync');
|
||||
|
||||
describe('Input', () => {
|
||||
describe('getFromUser', () => {
|
||||
it('does not throw', () => {
|
||||
@@ -33,4 +37,79 @@ describe('Input', () => {
|
||||
expect(Input.isValidFolderName(folderName)).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getPackageNameFromPackageJson', () => {
|
||||
it('throws error if package.json cannot be found at the given project path', () => {
|
||||
mockedFsExistsSync.mockReturnValue(false);
|
||||
|
||||
expect(() => Input.getPackageNameFromPackageJson('some/path')).toThrow(
|
||||
'Invalid projectPath - Cannot find package.json at some/path/package.json',
|
||||
);
|
||||
});
|
||||
|
||||
it('throws error if package.json contents cannot be parsed', () => {
|
||||
mockedFsExistsSync.mockReturnValue(true);
|
||||
mockedFsReadFileSync.mockReturnValue(Buffer.from('DefinitelyNotJSON'));
|
||||
|
||||
expect(() => Input.getPackageNameFromPackageJson('some/path')).toThrow(
|
||||
/Unable to parse package.json contents as JSON/,
|
||||
);
|
||||
});
|
||||
|
||||
it('throws error if name field in package.json is not present', () => {
|
||||
mockedFsExistsSync.mockReturnValue(true);
|
||||
mockedFsReadFileSync.mockReturnValue(
|
||||
Buffer.from(JSON.stringify({ notName: 'some-package', alsoNotName: 'some-package' })),
|
||||
);
|
||||
|
||||
expect(() => Input.getPackageNameFromPackageJson('some/path')).toThrow(
|
||||
'Unable to parse package name from package.json - package name should be string, but was undefined',
|
||||
);
|
||||
});
|
||||
|
||||
it('throws error if name field in package.json is present but not a string', () => {
|
||||
mockedFsExistsSync.mockReturnValue(true);
|
||||
mockedFsReadFileSync.mockReturnValue(
|
||||
Buffer.from(JSON.stringify({ name: 3, notName: 'some-package' })),
|
||||
);
|
||||
|
||||
expect(() => Input.getPackageNameFromPackageJson('some/path')).toThrow(
|
||||
'Unable to parse package name from package.json - package name should be string, but was number',
|
||||
);
|
||||
});
|
||||
|
||||
it('throws error if name field in package.json is present but empty', () => {
|
||||
mockedFsExistsSync.mockReturnValue(true);
|
||||
mockedFsReadFileSync.mockReturnValue(Buffer.from(JSON.stringify({ name: '', notName: 3 })));
|
||||
|
||||
expect(() => Input.getPackageNameFromPackageJson('some/path')).toThrow(
|
||||
'Package name from package.json is a string, but is empty',
|
||||
);
|
||||
});
|
||||
|
||||
it('returns the name field in package.json if it is present as a non-empty string', () => {
|
||||
mockedFsExistsSync.mockReturnValue(true);
|
||||
mockedFsReadFileSync.mockReturnValue(
|
||||
Buffer.from(JSON.stringify({ name: 'some-package', notName: 'not-what-we-want' })),
|
||||
);
|
||||
|
||||
expect(Input.getPackageNameFromPackageJson('some/path')).toStrictEqual('some-package');
|
||||
});
|
||||
});
|
||||
|
||||
describe('verifyTestsFolderIsPresent', () => {
|
||||
it('throws error if tests folder is not present', () => {
|
||||
mockedFsExistsSync.mockReturnValue(false);
|
||||
|
||||
expect(() => Input.verifyTestsFolderIsPresent('some/path')).toThrow(
|
||||
'Invalid projectPath - Cannot find package tests folder at some/path/Tests',
|
||||
);
|
||||
});
|
||||
|
||||
it('does not throw if tests folder is present', () => {
|
||||
mockedFsExistsSync.mockReturnValue(true);
|
||||
|
||||
expect(() => Input.verifyTestsFolderIsPresent('some/path')).not.toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import UnityVersionParser from './unity-version-parser';
|
||||
import fs from 'fs';
|
||||
import { getInput } from '@actions/core';
|
||||
|
||||
const Input = {
|
||||
get testModes() {
|
||||
return ['all', 'playmode', 'editmode'];
|
||||
return ['all', 'playmode', 'editmode', 'standalone'];
|
||||
},
|
||||
|
||||
isValidFolderName(folderName) {
|
||||
@@ -12,11 +13,59 @@ const Input = {
|
||||
return validFolderName.test(folderName);
|
||||
},
|
||||
|
||||
/**
|
||||
* When in package mode, we need to scrape the package's name from its package.json file
|
||||
*/
|
||||
getPackageNameFromPackageJson(packagePath) {
|
||||
const packageJsonPath = `${packagePath}/package.json`;
|
||||
if (!fs.existsSync(packageJsonPath)) {
|
||||
throw new Error(`Invalid projectPath - Cannot find package.json at ${packageJsonPath}`);
|
||||
}
|
||||
|
||||
let packageJson;
|
||||
|
||||
try {
|
||||
packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString());
|
||||
} catch (error) {
|
||||
if (error instanceof SyntaxError) {
|
||||
throw new SyntaxError(`Unable to parse package.json contents as JSON - ${error.message}`);
|
||||
}
|
||||
|
||||
throw new Error(`Unable to parse package.json contents as JSON - unknown error ocurred`);
|
||||
}
|
||||
|
||||
const rawPackageName = packageJson.name;
|
||||
|
||||
if (typeof rawPackageName !== 'string') {
|
||||
throw new TypeError(
|
||||
`Unable to parse package name from package.json - package name should be string, but was ${typeof rawPackageName}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (rawPackageName.length === 0) {
|
||||
throw new Error(`Package name from package.json is a string, but is empty`);
|
||||
}
|
||||
|
||||
return rawPackageName;
|
||||
},
|
||||
|
||||
/**
|
||||
* When in package mode, we need to ensure that the Tests folder is present
|
||||
*/
|
||||
verifyTestsFolderIsPresent(packagePath) {
|
||||
if (!fs.existsSync(`${packagePath}/Tests`)) {
|
||||
throw new Error(
|
||||
`Invalid projectPath - Cannot find package tests folder at ${packagePath}/Tests`,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
getFromUser() {
|
||||
// Input variables specified in workflow using "with" prop.
|
||||
const unityVersion = getInput('unityVersion') || 'auto';
|
||||
const customImage = getInput('customImage') || '';
|
||||
const rawProjectPath = getInput('projectPath') || '.';
|
||||
const unityLicensingServer = getInput('unityLicensingServer') || '';
|
||||
const customParameters = getInput('customParameters') || '';
|
||||
const testMode = (getInput('testMode') || 'all').toLowerCase();
|
||||
const coverageOptions = getInput('coverageOptions') || '';
|
||||
@@ -26,6 +75,9 @@ const Input = {
|
||||
const gitPrivateToken = getInput('gitPrivateToken') || '';
|
||||
const githubToken = getInput('githubToken') || '';
|
||||
const checkName = getInput('checkName') || 'Test Results';
|
||||
const rawPackageMode = getInput('packageMode') || 'false';
|
||||
let packageName = '';
|
||||
const chownFilesTo = getInput('chownFilesTo') || '';
|
||||
|
||||
// Validate input
|
||||
if (!this.testModes.includes(testMode)) {
|
||||
@@ -44,8 +96,28 @@ const Input = {
|
||||
throw new Error(`Invalid useHostNetwork "${rawUseHostNetwork}"`);
|
||||
}
|
||||
|
||||
// Sanitise input
|
||||
if (rawPackageMode !== 'true' && rawPackageMode !== 'false') {
|
||||
throw new Error(`Invalid packageMode "${rawPackageMode}"`);
|
||||
}
|
||||
|
||||
// sanitize packageMode input and projectPath input since they are needed
|
||||
// for input validation
|
||||
const packageMode = rawPackageMode === 'true';
|
||||
const projectPath = rawProjectPath.replace(/\/$/, '');
|
||||
|
||||
// if in package mode, attempt to get the package's name, and ensure tests are present
|
||||
if (packageMode) {
|
||||
if (unityVersion === 'auto') {
|
||||
throw new Error(
|
||||
'Package Mode is enabled, but unityVersion is set to "auto". unityVersion must manually be set in Package Mode.',
|
||||
);
|
||||
}
|
||||
|
||||
packageName = this.getPackageNameFromPackageJson(projectPath);
|
||||
this.verifyTestsFolderIsPresent(projectPath);
|
||||
}
|
||||
|
||||
// Sanitise other input
|
||||
const artifactsPath = rawArtifactsPath.replace(/\/$/, '');
|
||||
const useHostNetwork = rawUseHostNetwork === 'true';
|
||||
const editorVersion =
|
||||
@@ -65,6 +137,10 @@ const Input = {
|
||||
gitPrivateToken,
|
||||
githubToken,
|
||||
checkName,
|
||||
packageMode,
|
||||
packageName,
|
||||
chownFilesTo,
|
||||
unityLicensingServer,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
20
src/model/licensing-server-setup.ts
Normal file
20
src/model/licensing-server-setup.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as core from '@actions/core';
|
||||
import fs from 'fs';
|
||||
|
||||
class LicensingServerSetup {
|
||||
public static Setup(unityLicensingServer, actionFolder: string) {
|
||||
const servicesConfigPath = `${actionFolder}/unity-config/services-config.json`;
|
||||
const servicesConfigPathTemplate = `${servicesConfigPath}.template`;
|
||||
if (!fs.existsSync(servicesConfigPathTemplate)) {
|
||||
core.error(`Missing services config ${servicesConfigPathTemplate}`);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
let servicesConfig = fs.readFileSync(servicesConfigPathTemplate).toString();
|
||||
servicesConfig = servicesConfig.replace('%URL%', unityLicensingServer);
|
||||
fs.writeFileSync(servicesConfigPath, servicesConfig);
|
||||
}
|
||||
}
|
||||
|
||||
export default LicensingServerSetup;
|
||||
@@ -76,6 +76,12 @@ const ResultsCheck = {
|
||||
const pullRequest = github.context.payload.pull_request;
|
||||
const headSha = (pullRequest && pullRequest.head.sha) || github.context.sha;
|
||||
|
||||
const maxLength = 65_534;
|
||||
if (output.length > maxLength) {
|
||||
core.warning(`Output too long (${output.length}) truncating to ${maxLength}`);
|
||||
output = output.slice(0, maxLength);
|
||||
}
|
||||
|
||||
core.info(`Posting results for ${headSha}`);
|
||||
const createCheckRequest = {
|
||||
...github.context.repo,
|
||||
|
||||
@@ -114,6 +114,24 @@ describe('ResultsParser', () => {
|
||||
expect(result.annotation).toBeUndefined();
|
||||
});
|
||||
|
||||
test('no cdata in stack trace', () => {
|
||||
const result = ResultsParser.convertTestCase('Test Suite', {
|
||||
_attributes: {
|
||||
name: 'Test Name',
|
||||
duration: '3.14',
|
||||
},
|
||||
failure: {
|
||||
message: { _cdata: 'Message CDATA' },
|
||||
'stack-trace': {},
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.suite).toBe('Test Suite');
|
||||
expect(result.title).toBe('Test Name');
|
||||
expect(result.duration).toBe(3.14);
|
||||
expect(result.annotation).toBeUndefined();
|
||||
});
|
||||
|
||||
test('no annotation path', () => {
|
||||
const result = ResultsParser.convertTestCase('Test Suite', {
|
||||
_attributes: {
|
||||
|
||||
@@ -90,6 +90,10 @@ const ResultsParser = {
|
||||
}
|
||||
|
||||
const trace = failure['stack-trace']._cdata;
|
||||
if (trace === undefined) {
|
||||
core.warning(`No cdata in stack trace for test case: ${fullname}`);
|
||||
return testMeta;
|
||||
}
|
||||
const point = ResultsParser.findAnnotationPoint(trace);
|
||||
if (!point.path || !point.line) {
|
||||
core.warning(`Not able to find annotation point for failed test! Test trace: ${trace}`);
|
||||
|
||||
@@ -7,9 +7,9 @@ describe('UnityVersionParser', () => {
|
||||
});
|
||||
|
||||
it('parses from ProjectVersion.txt', () => {
|
||||
const projectVersionContents = `m_EditorVersion: 2019.2.11f1
|
||||
m_EditorVersionWithRevision: 2019.2.11f1 (5f859a4cfee5)`;
|
||||
expect(UnityVersionParser.parse(projectVersionContents)).toBe('2019.2.11f1');
|
||||
const projectVersionContents = `m_EditorVersion: 2022.3.7f1
|
||||
m_EditorVersionWithRevision: 2022.3.7f1 (b16b3b16c7a0)`;
|
||||
expect(UnityVersionParser.parse(projectVersionContents)).toBe('2022.3.7f1');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('UnityVersionParser', () => {
|
||||
});
|
||||
|
||||
it('reads from unity-project-with-correct-tests', () => {
|
||||
expect(UnityVersionParser.read('./unity-project-with-correct-tests')).toBe('2019.2.11f1');
|
||||
expect(UnityVersionParser.read('./unity-project-with-correct-tests')).toBe('2022.3.7f1');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
12
src/post.ts
Normal file
12
src/post.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import * as core from '@actions/core';
|
||||
import Action from './model/action';
|
||||
import { Docker } from './model';
|
||||
|
||||
export async function run() {
|
||||
try {
|
||||
const parameters = Action.runnerContext();
|
||||
await Docker.ensureContainerRemoval(parameters);
|
||||
} catch (error: any) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a62b511ba12825d4d9f992b4ed37a533
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3a65787d84893340b9dc38af5b7c31f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TimerComponent))]
|
||||
public class LevelScriptEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
TimerComponent myTarget = (TimerComponent)target;
|
||||
|
||||
EditorGUILayout.LabelField("Timer", myTarget.Timer.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0a715d2f35ea4c40a6f1cdae355c61c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "example.testpackage.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"example.testpackage.Runtime"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8223b1b52474b674a87c6113b6384f10
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e472ec5749e60ca4db87f10cec905d2c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21861106477d38342a589fc525c4e0bb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c6729c46a2a6594da2ce1182420ab81
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
public class BasicCounter
|
||||
{
|
||||
public const int MaxCount = 10;
|
||||
|
||||
public BasicCounter(int count = 0)
|
||||
{
|
||||
Count = count;
|
||||
}
|
||||
|
||||
public void Increment()
|
||||
{
|
||||
Count = Math.Min(MaxCount, Count + 1);
|
||||
}
|
||||
|
||||
public int Count { get; private set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bd8dfbd5c7fc9e439246091668234b0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class SampleComponent : MonoBehaviour
|
||||
{
|
||||
public BasicCounter Counter;
|
||||
|
||||
void Start()
|
||||
{
|
||||
Counter = new BasicCounter(5);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Counter.Increment();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 121f2ede62657a84082c012941df22d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class TimerComponent : MonoBehaviour
|
||||
{
|
||||
public BasicCounter Counter = new BasicCounter();
|
||||
public float Timer = 1f;
|
||||
|
||||
void Update()
|
||||
{
|
||||
Timer -= Time.deltaTime;
|
||||
|
||||
if (Timer > 0)
|
||||
return;
|
||||
|
||||
Counter.Increment();
|
||||
Timer = 1f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 563e4fb514abf6141b80ca1b71c08889
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "example.testpackage.Runtime",
|
||||
"rootNamespace": "",
|
||||
"references": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b20629d7e725e1e449076020f132df2a
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0f3a0ff2938264498234e4aaa66cf5f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7644cfe4cdc2d0f4ebc7ab351323a576
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
public class SampleEditModeTest
|
||||
{
|
||||
[Test]
|
||||
public void TestIncrement()
|
||||
{
|
||||
// Given
|
||||
var counter = new BasicCounter(0);
|
||||
|
||||
// When
|
||||
counter.Increment();
|
||||
|
||||
// Then
|
||||
Assert.AreEqual(1, counter.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMaxCount()
|
||||
{
|
||||
// Given
|
||||
var counter = new BasicCounter(BasicCounter.MaxCount);
|
||||
|
||||
// When
|
||||
counter.Increment();
|
||||
|
||||
// Then
|
||||
Assert.AreEqual(BasicCounter.MaxCount, counter.Count);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88de94cc1489d83488ce54f71b512989
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "example.testpackage.EditorTests",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"UnityEngine.TestRunner",
|
||||
"UnityEditor.TestRunner",
|
||||
"example.testpackage.Editor",
|
||||
"example.testpackage.Runtime"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"nunit.framework.dll"
|
||||
],
|
||||
"autoReferenced": false,
|
||||
"defineConstraints": [
|
||||
"UNITY_INCLUDE_TESTS"
|
||||
],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5712d2009ce3b34a8ca077667b16764
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4f774583b1374a4abe450c7100726bd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Collections;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
public class SampleComponentTest
|
||||
{
|
||||
private GameObject target;
|
||||
private SampleComponent component;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
target = GameObject.Instantiate(new GameObject());
|
||||
component = target.AddComponent<SampleComponent>();
|
||||
}
|
||||
|
||||
[UnityTest]
|
||||
public IEnumerator TestIncrementOnUpdateAfterNextFrame()
|
||||
{
|
||||
// Save the current value, since it was updated after component Start() method called
|
||||
var count = component.Counter.Count;
|
||||
|
||||
// Skip frame and assert the new value
|
||||
yield return null;
|
||||
Assert.AreEqual(count + 1, component.Counter.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b551b84934711564eb78aab8c16425ac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Collections;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
public class SamplePlayModeTest
|
||||
{
|
||||
// A Test behaves as an ordinary method
|
||||
[Test]
|
||||
public void NewTestScriptSimplePasses()
|
||||
{
|
||||
// Given
|
||||
var counter = new BasicCounter(0);
|
||||
|
||||
// When
|
||||
counter.Increment();
|
||||
|
||||
// Then
|
||||
Assert.AreEqual(1, counter.Count);
|
||||
}
|
||||
|
||||
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
|
||||
// `yield return null;` to skip a frame.
|
||||
[UnityTest]
|
||||
public IEnumerator NewTestScriptWithEnumeratorPasses()
|
||||
{
|
||||
// Given
|
||||
var counter = new BasicCounter(3);
|
||||
|
||||
// Use the Assert class to test conditions.
|
||||
// Use yield to skip a frame.
|
||||
yield return null;
|
||||
|
||||
// When
|
||||
counter.Increment();
|
||||
|
||||
// Then
|
||||
Assert.AreEqual(4, counter.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4dbe2d2dc79550c4d81602bcf94a9824
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,66 @@
|
||||
using System.Collections;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
public class TimerComponentTest
|
||||
{
|
||||
private GameObject target;
|
||||
private TimerComponent component;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
target = GameObject.Instantiate(new GameObject());
|
||||
component = target.AddComponent<TimerComponent>();
|
||||
}
|
||||
|
||||
[UnityTest]
|
||||
public IEnumerator TestIncrementAfterSomeTime()
|
||||
{
|
||||
// Save the current value, since it was updated after component Start() method called
|
||||
var count = component.Counter.Count;
|
||||
|
||||
// Skip frame and assert the new value
|
||||
yield return null;
|
||||
Assert.AreEqual(count, component.Counter.Count);
|
||||
|
||||
yield return new WaitForSeconds(1.1f);
|
||||
Assert.AreEqual(count + 1, component.Counter.Count);
|
||||
|
||||
yield return new WaitForSeconds(1.1f);
|
||||
Assert.AreEqual(count + 2, component.Counter.Count);
|
||||
}
|
||||
|
||||
[UnityTest]
|
||||
public IEnumerator TestTimeScaleIsAffectingIncrement()
|
||||
{
|
||||
// Save the current value, since it was updated after component Start() method called
|
||||
var count = component.Counter.Count;
|
||||
Time.timeScale = .5f;
|
||||
|
||||
// Skip frame and assert the new value
|
||||
yield return null;
|
||||
Assert.AreEqual(count, component.Counter.Count);
|
||||
|
||||
yield return WaitForRealSeconds(1.1f);
|
||||
Assert.AreEqual(count, component.Counter.Count);
|
||||
|
||||
yield return WaitForRealSeconds(1.1f);
|
||||
Assert.AreEqual(count + 1, component.Counter.Count);
|
||||
}
|
||||
|
||||
// Skipping time ignoring Time.scale
|
||||
// https://answers.unity.com/questions/301868/yield-waitforseconds-outside-of-timescale.html
|
||||
public static IEnumerator WaitForRealSeconds(float time)
|
||||
{
|
||||
float start = Time.realtimeSinceStartup;
|
||||
while (Time.realtimeSinceStartup < start + time)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 010121a56a70d60428dc89307eb77b54
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "example.testpackage.RuntimeTests",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"UnityEngine.TestRunner",
|
||||
"UnityEditor.TestRunner",
|
||||
"example.testpackage.Runtime"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"nunit.framework.dll"
|
||||
],
|
||||
"autoReferenced": false,
|
||||
"defineConstraints": [
|
||||
"UNITY_INCLUDE_TESTS"
|
||||
],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 902aaaf7a59149243b2f4e38fc9f388e
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "com.example.testpackage",
|
||||
"version": "0.0.1",
|
||||
"displayName": "Test Package",
|
||||
"description": "Test Package",
|
||||
"unity": "2022.3",
|
||||
"unityRelease": "7f1",
|
||||
"keywords": [
|
||||
"nothing"
|
||||
],
|
||||
"author": {
|
||||
"name": "Example Author",
|
||||
"email": "author@example.com",
|
||||
"url": "example.com"
|
||||
},
|
||||
"type": "tool",
|
||||
"hideInEditor": false
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user