com.unity.uiextensions.nosa.../.github/workflows/rununitysinglebuild.yml

424 lines
17 KiB
YAML
Raw Permalink Normal View History

Release 2.3.0 (#429) * Package upver for Development * Added OnHighlightChanged and OnPressChanged events Added getters and setters for Highlighted and Pressed * Patch fix for UILineRenderer * Update package preview release * Resolves issue where the lower range value would become stuck when moved to the max value position Resolves: https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/381/cant-move-range-slider-if-low-is-moved-to * Updated Infinite scroll to work with content of different sizes * Clean-up and reset pivots on scene start * Patches from PR * Clean up range slider unused variables * Updated Dropdown list to NOT resize text Rect on draw * Upgraded RangeSlider to work in both Horizontal and Verticle setups, just like regular slider. Also fixed a minor issue with offset when dragging on the bar. # Conflicts: # Runtime/Scripts/Controls/RangeSlider.cs * Taking in fix from https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/pull-requests/132 * Applying PR manually, because Bitbucket https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/pull-requests/128 * Merged in fix manually because... Bitbucket https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/pull-requests/130 * Remove old BitBucket Pipeline for GitHub * Fixes issue #398 where the Next / Previous buttons filed to work if the ScrollSnap was previously scrolling. Also renamed the Extension Methods scripts and added a new function. Resolves: #398 * Resolves #397 Moved OnValidate checks which redraw the component to the RectTransformDimensionsCHanged event * Updated UIParticleSystem access to Particles array to ensure it is more stable. Updated some #if statements to be better future proofed Resolves #360 * Fixed the UIConnector to safely handle when no parent canvas can be found. Resolves #392 * Fixed issue which allowed an item marked as NOT transferable to actually be transferred between lists Resolves #382 * Updated #if filter inclusion to 2019_1_OR_Newer resolves: - https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/411 * Updated UIVertical scroller to be 2022 compliant Resolves: - https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/410 * Updated Curly UI to wait until end of the frame to recalculate positions Also updated Editor script to work in 2022 Resolves: - https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/409 * Updated Depth Texture sampler in UI Particles Shaders Resolves: - https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/401 * Remove meta duplicates for HSVColour Picker * Add newly generated HSV picker meta files * Hard reset of Colour picker guids * Updated Points to always be an array of 1 when set to nothing. Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/295 * Updated Cooldown button to work with Keyboard input Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/171 * Added error handling around setting Unity UI Components for Vertical/Horizontal scrolling Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/296 * Protecting Remove too * Added SetArc method to UICircle as requested Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/280 * Marked ScrollPositionController as Obsolete, users should use the newer Scroller component instead, will be removed in a future release. Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/305 * Updated ScrollPositionControllerEditor as obsolete too * Removed unneeded size calculation which caused some issues with mixed height/width children. Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/380 * Resolved issue whereby the last row in a flow layout group would not size correctly. Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/357 * Updated all components using "LayoutGroup" to override their OnDisable feature to incorporate this fix: https://gist.github.com/randomize/73ca6d3b6aa7210073692eb5cabd537e Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/178 * Checking in new MinMaxSlider TODO - Finish Editor creator * Added Editor Menu Option to create a Min/Max slider Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/270 * Marked TileSizeFitter as obsolete as Unity has made this unworkable Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/214 * Updated Editor create options to add the correct Event System Input module for the Input system used, now or old. Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/378 * Updated Editor menu layout * Updated initialisation logic to not cause an endless loop in the TabNavigationHelper Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/208 * Added new FIFO based UI Line Render when dynamic line rendering is needed (basic, no Beziers) Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/324 * Clean-up of ScrollSnapBase * Updated "Action" use to "UnityAction" to avoid Unity issues Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/253 * Updated UIVerticalScroller for standards and added UIHorizontalScroller Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/205 * Updated ReorderableList/ReorderableListElement to prevent creating a "Fake" droppable when the item is not transferable Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/164 * Updated panel drawing for ComboBox controls and added DropdownOffset Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/393 * Base update for pointers to new version / package home * Cleanup and ensuring the UIParticleSystem is disposed on Destroy correctly. Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/412 * Refresh FancyScrollView with latest fixes * Remove broken examples link * Break Module * Update Examples module to new home * Updating GitHub artifacts and automation * Updated build issue with ReorderableListElement * Revised the Curly UI fix as it was preventing the graphic from being updated in the scene view. Thanks to @solidsign for the update. * Removed legacy Examples link, moving to separate repository * Added new submodule for extracted examples * Fix class spellings and update MultiTouchScrollRect * Updated NonDrawingGraphic to require a CanvasRender, else it causes an error on run (and doesn't work) - Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/420 * Add updated test flow for builds * Fix github issue templates * Add the Version upgrade pipeline * Added ResetSelectableHighlight component * Resolves issue in 2022 with the missing Text component Fixes: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/424 * The BIG Unity 2022 Text reorganisation * Remove editor validation and add error checking for the ColorLabel component * Add 2019 to the testing validation * Switch android builds to windows * Several lifetime feature updates for the ComboBox controls: - Resolves startup issue that prevented the control being used (Unity changed the start order in some instances), this was causing null reference issues with comboboxes - Added the ability to set a specific item on start and not just the first - Added the ability to disable the dropdown to make a read-only dropdown Resolves: - https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/426 - https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/425 * Resolved issues with DisplayAbove and using a 0 ItemsToDisplay * Update pipelines for release * Final checks for merge! --------- Co-authored-by: Robert Rioja <rrioja@immersivedisplayinc.com> Co-authored-by: Simon Jackson <darkside@xna-uk.net> Co-authored-by: Ben MacKinnon <bilmackinnon@googlemail.com> Co-authored-by: Simon Jackson <sjackson@ethar.com> Co-authored-by: action <action@users.noreply.github.com>
2023-02-07 22:35:43 +08:00
name: Run Limited Unity Builds
on:
workflow_call:
inputs:
unityVersion:
description: "The version of Unity to validate on"
required: true
type: string
dependencies:
description: "json array of dependencies and their targets"
required: false
type: string
jobs:
run_build:
name: Run Unity Build process
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos
build-target: iOS
- os: windows
build-target: Android
- os: windows
build-target: StandaloneWindows64
- os: windows
build-target: WSAPlayer
steps:
- name: Script Version
run: |
echo "::group::Script Versioning"
$scriptVersion = "1.0.0"
echo "Build Script Version: $scriptVersion"
echo "::endgroup::"
shell: pwsh
- uses: actions/checkout@v3
with:
submodules: recursive
clean: true
- id: build
name: 'Run Unity Builds'
run: |
echo "::group::Set Hub and editor locations"
$unityVersion = ${{ inputs.unityVersion }}
echo "::group::Set Hub and editor locations"
## Set Hub and editor locations
if ( (-not $global:PSVersionTable.Platform) -or ($global:PSVersionTable.Platform -eq "Win32NT") )
{
$hubPath = "C:\Program Files\Unity Hub\Unity Hub.exe"
$editorRootPath = "C:\Program Files\Unity\Hub\Editor\"
$editorFileEx = "\Editor\Unity.exe"
#"Unity Hub.exe" -- --headless help
#. 'C:\Program Files\Unity Hub\Unity Hub.exe' -- --headless help
function unity-hub
{
& $hubPath -- --headless $args.Split(" ") | Out-String -NoNewline
}
}
elseif ( $global:PSVersionTable.OS.Contains("Darwin") )
{
$hubPath = "/Applications/Unity Hub.app/Contents/MacOS/Unity Hub"
$editorRootPath = "/Applications/Unity/Hub/Editor/"
$editorFileEx = "/Unity.app/Contents/MacOS/Unity"
# /Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless help
function unity-hub
{
& $hubPath -- --headless $args.Split(" ") | Out-String -NoNewline
}
}
elseif ( $global:PSVersionTable.OS.Contains("Linux") )
{
$hubPath = "$HOME/Unity Hub/UnityHub.AppImage"
$editorRootPath = "$HOME/Unity/Hub/Editor/"
$editorFileEx = "/Editor/Unity"
# /UnityHub.AppImage --headless help
# xvfb-run --auto-servernum "$HOME/Unity Hub/UnityHub.AppImage" --headless help
function unity-hub
{
xvfb-run --auto-servernum "$hubPath" --headless $args.Split(" ")
}
}
echo "::endgroup::"
echo "::group::Get String function to query a string for a value"
function GetString($InputString, $InputPattern, $MatchIndex)
{
$regExResult = $InputString | Select-String -Pattern $InputPattern
if($regExResult.Length -gt 0)
{
return $regExResult.Matches[$MatchIndex].Value
}
else
{
return 0
}
}
function Get-LetterCount
{
Param ([string]$string)
return $string.Length
}
echo "::endgroup::"
echo "::group::Get Installed Unity version based on Matrix"
echo 'Script Start'
echo "Unity hub path is {$hubPath}"
echo "Requested unity version is {$unityVersion}"
$InstalledUnityVersions = unity-hub editors
$editorRootPath = unity-hub ip -g
echo "Installed unity versions are {$InstalledUnityVersions}"
echo "Unity install path is {$editorRootPath}"
$versionLength = Get-LetterCount $unityVersion
if ($versionLength -eq 4) {
$queryUnityVersion = GetString $InstalledUnityVersions "$unityVersion.{4,7}" -MatchIndex 0
}
elseif ($versionLength -eq 6) {
$queryUnityVersion = GetString $InstalledUnityVersions "$unityVersion.{4,5}" -MatchIndex 0
}
else {
$queryUnityVersion = GetString $InstalledUnityVersions "$unityVersion" -MatchIndex 0
}
echo "Found unity version is {$queryUnityVersion}"
if ($queryUnityVersion -ne 0)
{
$unityVersion = $queryUnityVersion.Trim(","," ").Trim()
echo "Long Unity version is $unityVersion"
}
else
{
echo "Unity $unityVersion not found on this machine, skipping"
exit 0
}
echo "::endgroup::"
echo "::group::Search for Editor if not found"
$checkPath = Join-Path $editorRootPath $unityVersion
echo "Testing for editor at $checkPath"
while (-not (Test-Path "$checkPath")) {
$source = $unityVersion.Replace("f1","")
$newversion = $source.Split(".")
$newversion[2] = [int]$newversion[2] - 1
if ([int]$newversion[2] -lt 1) {
echo "Unity ${{ inputs.unityVersion }} not found on this machine, skipping"
exit 0
}
$newunityVersion = "{0}.{1}.{2}f1" -f $newversion[0],$newversion[1],$newversion[2]
echo "Unity $unityVersion not found on this machine, trying $newunityVersion"
$unityVersion = $newunityVersion
$checkPath = Join-Path $editorRootPath $unityVersion
}
echo "::endgroup::"
echo "::group::Set editor locations"
if ( (-not $global:PSVersionTable.Platform) -or ($global:PSVersionTable.Platform -eq "Win32NT") ) {
echo 'Building using Windows'
$editorFileEx = "/Editor/Unity.exe"
$editorrunpath = Join-Path $editorRootPath $unityVersion $editorFileEx
function unity-editor {
#$p = Start-Process -Verbose -NoNewWindow -PassThru -Wait -FilePath "$editorrunpath" -ArgumentList (@(' -batchmode') + $args.Split(" "))
& $editorrunpath -batchmode $args.Split(" ") | Out-String
}
}
elseif ( $global:PSVersionTable.OS.Contains("Darwin") ) {
echo 'Building using Mac'
$editorFileEx = "/Unity.app/Contents/MacOS/Unity"
$editorrunpath = Join-Path $editorRootPath $unityVersion $editorFileEx
function unity-editor {
#$p = Start-Process -Verbose -NoNewWindow -PassThru -Wait -FilePath "$editorrunpath" -ArgumentList (@(' -batchmode') + $args.Split(" "))
& $editorrunpath -batchmode $args.Split(" ") | Out-String
}
}
elseif ( $global:PSVersionTable.OS.Contains("Linux") ) {
echo 'Building using Linux'
$editorFileEx = "/Editor/Unity"
$editorrunpath = Join-Path $editorRootPath $unityVersion $editorFileEx
function unity-editor {
xvfb-run --auto-servernum "$editorrunpath" -batchmode $args.Split(" ")
}
}
else
{
echo 'Unknown build platform'
}
echo "::endgroup::"
echo "::group::Test Unity version is installed"
if ( -not (Test-Path "$editorrunpath") )
{
Write-Error "Editor not Found for $unityVersion"
exit 1
}
else {
echo "Editor Path is {$editorrunpath}"
}
echo "::endgroup::"
echo "::group::Setup logging and run Unit tests"
# Log detail
$logDirectory = "Logs"
if (Test-Path -Path $logDirectory) {
echo "Clearing logs from a previous run"
Remove-item $logDirectory -recurse
}
$logDirectory = New-Item -ItemType Directory -Force -Path $logDirectory | Select-Object
echo "Log Directory: $logDirectory"
$date = Get-Date -Format "yyyyMMddTHHmmss"
# If run manually, the Refname is actually blank, so just use date
if([string]::IsNullOrEmpty(${GITHUB_REF_NAME})) {
$logName = "$logDirectory$directorySeparatorChar$date"
}
else{
$logName = "$logDirectory$directorySeparatorChar${GITHUB_REF_NAME}-$date"
}
$logPath = "$logName.log"
$testsLogPath = "$logName-tests.xml"
echo "Logpath [$logPath]"
echo "TestsPath [$testsLogPath]"
echo "::endgroup::"
echo "::group::Grouping Package in a UPM folder"
$UPMFolderName = 'u'
if ( -not (Test-Path '$UPMFolderName') )
{
New-Item $UPMFolderName -ItemType Directory
}
Move-Item -Path * -Destination $UPMFolderName -exclude $UPMFolderName
echo "::endgroup::"
echo "::group::Creating Temp Unity project"
$TempUnityProjectName = 'P'
unity-editor '-createProject' $TempUnityProjectName -quit
$destinationPath = $TempUnityProjectName + $directorySeparatorChar + 'packages'
Move-Item -Path $UPMFolderName -Destination $destinationPath
echo "::endgroup::"
echo "::group::If required, clone dependencies in to test project"
<# Dependency option requires specific inputs
* A dependency input string in json format, listing each dependency by name and git url, e.g.
$dependencies = '[{"ASADependencies": "github.com/SimonDarksideJ/upmGithubActionsTests.git"}]'
*Note, remove the https:// portion to allow using a PAT to access the repo
The Name of the dependency should ALSO MATCH the name of the branch on the repo where the dependency is held (files intended for the packages folder)
* Additionally, if Manifest entries are required, then a manifest file with those dependencies (and ONLY the new dependancies) should also be in the dependency branch named the same as the branch name
e.g. "ASADependencies.json" - keep the same structure, but only the dependancy entries
!!Does NOT support additional scoped registries at this time! #>
echo "---------------------------------------------"
echo "Read dependancy input value"
if([string]::IsNullOrEmpty('${{ inputs.dependencies }}'))
{
echo "No dependencies provided"
echo "input ${{ inputs.dependencies }}"
echo "------------------------------"
}
else {
echo "dependencies provided, validating"
# Read dependancy input value
$dependencies = '${{ inputs.dependencies }}'
if([string]::IsNullOrEmpty('${{ secrets.GIT_USER_NAME }}') -or [string]::IsNullOrEmpty('${{ secrets.GIT_PAT }}')){
echo ""
echo "Secrets for GIT_USER_NAME or GIT_PAT missing, please register them with access to this runner"
echo "*Note, Organisation secrets are not accessible to Forked repos and need registering in the local fork"
exit 1
}
echo "---------------------------------------------"
echo "Read dependancy input values as json"
$JSONdependencies = $dependencies | ConvertFrom-Json
echo $JSONdependencies
# Read current Manifest json
$manifestPath = $destinationPath + $directorySeparatorChar + 'manifest.json'
$projectManifest = Get-Content -Path $manifestPath | ConvertFrom-Json
$strArray = $projectManifest.dependencies.PsObject.Properties | ForEach-Object {"$($_.Name)@$($_.Value),"}
echo "---------------------------------------------"
echo "Loop through new dependancies and add them to the project Manifest"
foreach($dependency in $JSONdependencies){
$dependency.PsObject.Properties | ForEach-Object -Process {
$dependencyName = $_.Name
$dependencyPath = $dependencyName.Replace("/","_")
$dependencyURL = $_.Value
echo "---------------------------------------------"
echo "Cloning dependency - Name [$dependencyName] - Path [$dependencyPath] - URL [$dependencyURL]"
$cloneURL = "https://${{ secrets.GIT_USER_NAME }}:${{ secrets.GIT_PAT }}@$dependencyURL"
echo "cloning $dependencyName from $dependencyURL and moving to $destinationPath"
echo "git path - $cloneURL"
# Clone Dependancy repo to destination folder
git clone -b $dependencyName --single-branch $cloneURL $dependencyPath
if( -not (Test-Path -Path "$dependencyPath")){
echo "Unable to clone $dependencyName from $dependencyURL"
exit 1
}
# Move files from clone path into packages folder, if the dependency contains a UPM package then move the entire folder and not just its contents
if (Test-Path -Path "$dependencyPath/package.json") {
$package_json = Get-Content -Path $dependencyPath/package.json | ConvertFrom-Json
$packageName = $package_json.name
Rename-Item $dependencyPath $packageName
echo "Moving whole $packageName UPM package to $destinationPath"
Move-Item -Path "$packageName" -Destination $destinationPath
}
else {
echo "Moving the contents of $dependencyName into the $destinationPath folder"
Move-Item -Path "$dependencyPath/*" -Destination $destinationPath
}
# Get Dependency manifest entries (if applicable)
if (Test-Path -Path "$destinationPath/$dependencyName.json") {
$dependencyManifest = Get-Content -Path "$destinationPath/$dependencyName.json" | ConvertFrom-Json
$dependencyManifest.dependencies.PsObject.Properties | ForEach-Object {
$strArray += "$($_.Name)@$($_.Value),"
}
}
else{
echo "No denendency json found called $destinationPath/$dependencyName.json, skipping adding additional manifest entries"
}
}
}
echo "---------------------------------------------"
# Reformat combined dependancies list
$strArray = $strArray.Trim(",") | ConvertTo-Json
$strArray = $strArray.Replace("@",'":"').Replace("[","{").Replace("]","}")
$strArrayObject = $strArray | ConvertFrom-Json
# Save manifest back to project
$projectManifest.dependencies = $strArrayObject
$projectManifest | ConvertTo-Json | Set-Content -Path "$destinationPath/manifest.json"
echo "Project updated with the following dependencies"
echo "-----------------------------------------------"
echo $projectManifest
}
echo "::endgroup::"
echo "::group::Run build"
echo "---------------------------------------------"
echo "Start Testing"
echo "Unity Command\n[unity-editor -projectPath $TempUnityProjectName -logfile $logPath -batchmode -nographics -quit -buildTarget ${{ matrix.build-target }}]"
unity-editor -projectPath $TempUnityProjectName -logfile $logPath -batchmode -nographics -quit -buildTarget ${{ matrix.build-target }}
echo "---------------------------------------------"
echo "::group::Unity Unit tests Results"
if (Test-Path $testsLogPath) {
echo "Test Run results for ${GITHUB_REPOSITORY} Branch ${GITHUB_REF}"
echo ""
Select-Xml -Path $testsLogPath -XPath '/test-run/test-suite' | ForEach-Object { "Name: " +$_.Node.name, ", Result: " + $_.Node.result, ", Total Tests: " + $_.Node.total, ", Passed: " + $_.Node.passed, ", Failed: " + $_.Node.failed, ", Skipped: " + $_.Node.skipped }
}
else {
echo "No test results found for ${GITHUB_REPOSITORY} Branch ${GITHUB_REF} at $testsLogPath"
echo ""
}
echo "::endgroup::"
if($LASTEXITCODE -ne '0'){
echo "::group::Unity Unit tests errors"
$exitCode = $testResult.ExitCode
Get-Content $logPath
echo "Build failed due to errors ($LASTEXITCODE), please check the log at $logPath"
echo "::endgroup::"
exit $LASTEXITCODE
}
echo "::endgroup::"
shell: pwsh
- uses: actions/upload-artifact@v3
if: always()
with:
name: unity-build-log
path: Logs/**