Fixes, improvements, and cleanup while reconciling test runner scripts

This commit is contained in:
Andrew Kahr 2023-12-10 01:33:05 -08:00
parent 0e7097bfa5
commit d491502486
7 changed files with 66 additions and 28 deletions

Binary file not shown.

View File

@ -75,11 +75,12 @@ else
# #
echo "License activation strategy could not be determined." echo "License activation strategy could not be determined."
echo "" echo ""
echo "Visit https://game.ci/docs/github/getting-started for more" echo "Visit https://game.ci/docs/github/activation for more"
echo "details on how to set up one of the possible activation strategies." echo "details on how to set up one of the possible activation strategies."
echo "::error ::No valid license activation strategy could be determined. Make sure to provide UNITY_EMAIL, UNITY_PASSWORD, and either a UNITY_SERIAL \ echo "::error ::No valid license activation strategy could be determined. Make sure to provide UNITY_EMAIL, UNITY_PASSWORD, and either a UNITY_SERIAL \
or UNITY_LICENSE. Otherwise please use UNITY_LICENSING_SERVER." or UNITY_LICENSE. Otherwise please use UNITY_LICENSING_SERVER. See more info at https://game.ci/docs/github/activation"
# Immediately exit as no UNITY_EXIT_CODE can be derived. # Immediately exit as no UNITY_EXIT_CODE can be derived.
exit 1; exit 1;
@ -98,6 +99,3 @@ else
echo "::error ::There was an error while trying to activate the Unity license." echo "::error ::There was an error while trying to activate the Unity license."
exit $UNITY_EXIT_CODE exit $UNITY_EXIT_CODE
fi fi
# Return to previous working directory
popd

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ -n "$UNITY_LICENSING_SERVER" ]]; then # if [[ -n "$UNITY_LICENSING_SERVER" ]]; then
# #
# Return any floating license used. # Return any floating license used.
# #
@ -20,6 +20,3 @@ elif [[ -n "$UNITY_SERIAL" ]]; then
-password "$UNITY_PASSWORD" \ -password "$UNITY_PASSWORD" \
-projectPath "/BlankProject" -projectPath "/BlankProject"
fi fi
# Return to previous working directory
popd

View File

@ -6,11 +6,42 @@ Write-Output "# Activating #"
Write-Output "###########################" Write-Output "###########################"
Write-Output "" Write-Output ""
& "$Env:UNITY_PATH/Editor/Unity.exe" -batchmode -quit -nographics ` if ( ($null -ne ${env:UNITY_SERIAL}) -and ($null -ne ${env:UNITY_EMAIL}) -and ($null -ne ${env:UNITY_PASSWORD}) )
{
#
# SERIAL LICENSE MODE
#
# This will activate unity, using the serial activation process.
#
Write-Output "Requesting activation"
$ACTIVATION_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "$Env:UNITY_PATH/Editor/Unity.exe" `
-ArgumentList `
"-batchmode `
-quit `
-nographics `
-username $Env:UNITY_EMAIL ` -username $Env:UNITY_EMAIL `
-password $Env:UNITY_PASSWORD ` -password $Env:UNITY_PASSWORD `
-serial $Env:UNITY_SERIAL ` -serial $Env:UNITY_SERIAL `
-projectPath "c:/BlankProject" ` -projectPath c:/BlankProject `
-logfile - | Out-Host -logfile -"
$ACTIVATION_EXIT_CODE = $LASTEXITCODE $ACTIVATION_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/activation for more"
Write-Output "details on how to set up one of the possible activation strategies."
Write-Output "::error ::No valid license activation strategy could be determined. Make sure to provide UNITY_EMAIL, UNITY_PASSWORD, and either a UNITY_SERIAL \
or UNITY_LICENSE. Otherwise please use UNITY_LICENSING_SERVER. See more info at https://game.ci/docs/github/activation"
$ACTIVATION_EXIT_CODE = 1;
}

View File

@ -156,7 +156,7 @@ $unityArgs = @(
# Remove null items as that will fail the Start-Process call # Remove null items as that will fail the Start-Process call
$unityArgs = $unityArgs | Where-Object { $_ -ne $null } $unityArgs = $unityArgs | Where-Object { $_ -ne $null }
$unityProcess = Start-Process -FilePath "$Env:UNITY_PATH\Editor\Unity.exe" ` $unityProcess = Start-Process -FilePath "$Env:UNITY_PATH/Editor/Unity.exe" `
-ArgumentList $unityArgs ` -ArgumentList $unityArgs `
-PassThru ` -PassThru `
-NoNewWindow -NoNewWindow

View File

@ -6,9 +6,21 @@ Write-Output "# Return License #"
Write-Output "###########################" Write-Output "###########################"
Write-Output "" Write-Output ""
& "$Env:UNITY_PATH\Editor\Unity.exe" -batchmode -quit -nographics ` if ($null -ne ${env:UNITY_SERIAL})
{
#
# SERIAL LICENSE MODE
#
# This will return the license that is currently in use.
#
$RETURN_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "$Env:UNITY_PATH/Editor/Unity.exe" `
-ArgumentList `
"-batchmode `
-quit `
-nographics `
-username $Env:UNITY_EMAIL ` -username $Env:UNITY_EMAIL `
-password $Env:UNITY_PASSWORD ` -password $Env:UNITY_PASSWORD `
-returnlicense ` -returnlicense `
-projectPath "c:/BlankProject" ` -projectPath c:/BlankProject `
-logfile - | Out-Host -logfile -"
}

View File

@ -1,4 +1,4 @@
if ([string]::IsNullOrEmpty($env:GIT_PRIVATE_TOKEN)) { if ($null -eq ${env:GIT_PRIVATE_TOKEN}) {
Write-Host "GIT_PRIVATE_TOKEN unset skipping" Write-Host "GIT_PRIVATE_TOKEN unset skipping"
} }
else { else {