@@ -218,11 +218,8 @@ jobs:
218218            Write-Output "❌ Editor folder does not exist" 
219219            exit 1 
220220          } 
221-        - name : Force clean package resolution 
222-         run : | 
223-           Write-Output "Removing Library folder to force clean package resolution..." 
224-           if (Test-Path "sample-unity6/Library") { Remove-Item -Recurse -Force "sample-unity6/Library" } 
225-           Write-Output "✅ Library folder removed" 
221+        #  Don't delete Library folder - let Unity reuse cached package data if available
222+       #  Deleting it forces a complete reimport which takes too long
226223      - name : Ensure Tests directory exists 
227224        run : | 
228225          Write-Output "Ensuring Tests directory/symlink exists..." 
@@ -252,25 +249,35 @@ jobs:
252249           
253250          Write-Output "Unity process started (PID: $($unityProcess.Id))" 
254251          Write-Output "Waiting for package import to complete..." 
255-           Write-Output "Will check for completion every 10 seconds (max 5 minutes)" 
252+           Write-Output "Will check for completion every 15 seconds (max 10 minutes)" 
253+           Write-Output "" 
256254           
257-           $maxWaitSeconds = 300  
258-           $checkInterval = 10  
255+           $maxWaitSeconds = 600  # 10 minutes - package import can take a while  
256+           $checkInterval = 15  
259257          $elapsed = 0 
260258          $packagesImported = $false 
261259           
262260          while ($elapsed -lt $maxWaitSeconds) { 
263261            Start-Sleep -Seconds $checkInterval 
264262            $elapsed += $checkInterval 
265263             
266-             # Check if AltTester package has been imported 
267-             if (Test-Path "${{ github.workspace }}\sample-unity6\Library\PackageCache\*alttester*") { 
268-               Write-Output "✅ AltTester package found! Packages have been imported." 
269-               $packagesImported = $true 
270-               break 
264+             # Check if Library folder exists and has PackageCache 
265+             if (Test-Path "${{ github.workspace }}\sample-unity6\Library\PackageCache") { 
266+               $packageCount = (Get-ChildItem "${{ github.workspace }}\sample-unity6\Library\PackageCache" -Directory -ErrorAction SilentlyContinue | Measure-Object).Count 
267+               Write-Output "PackageCache exists with $packageCount packages ($elapsed seconds elapsed)" 
268+                
269+               # Check if AltTester package has been imported 
270+               if (Test-Path "${{ github.workspace }}\sample-unity6\Library\PackageCache\*alttester*") { 
271+                 Write-Output "✅ AltTester package found! Packages should be ready." 
272+                 $packagesImported = $true 
273+                 # Wait a bit more to ensure everything is settled 
274+                 Write-Output "Waiting 30 more seconds to ensure all packages are fully imported..." 
275+                 Start-Sleep -Seconds 30 
276+                 break 
277+               } 
278+             } else { 
279+               Write-Output "PackageCache not yet created ($elapsed seconds elapsed)" 
271280            } 
272-              
273-             Write-Output "Still importing... ($elapsed seconds elapsed)" 
274281          } 
275282           
276283          # Kill Unity process 
0 commit comments