Include extra_nes_games in download validation #1407
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'EmulationStation Setup Test' | |
| on: | |
| push: | |
| branches: [master, dev, test, test-modernized-emulators] | |
| pull_request: | |
| branches: [master] | |
| # schedule: | |
| # - cron: "0 0 */2 * *" | |
| jobs: | |
| test-setup: | |
| runs-on: windows-latest | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup PowerShell execution policy | |
| run: Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force | |
| shell: powershell | |
| - name: Display system information | |
| run: | | |
| Write-Host "Windows Version: $(Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version)" | |
| Write-Host "PowerShell Version: $($PSVersionTable.PSVersion)" | |
| Write-Host "Available Disk Space: $([math]::Round((Get-WmiObject -Class Win32_LogicalDisk -Filter "DeviceID='C:'").FreeSpace / 1GB, 2)) GB" | |
| shell: powershell | |
| - name: Test download validation | |
| run: | | |
| Write-Host "Testing all download URLs from download_list.json..." | |
| $json = Get-Content "download_list.json" | ConvertFrom-Json | |
| $testCount = 0 | |
| $failedUrls = @() | |
| $successCount = 0 | |
| $totalUrls = 0 | |
| # Test all downloads | |
| foreach($item in $json.downloads) { | |
| $totalUrls++ | |
| $testCount++ | |
| Write-Host "Testing downloads $testCount - $($item.file)" | |
| try { | |
| $response = Invoke-WebRequest -Uri $item.url -Method Head -UseBasicParsing -TimeoutSec 15 | |
| Write-Host "SUCCESS $($item.file)" | |
| $successCount++ | |
| } catch { | |
| Write-Host "FAILED $($item.file) - $($_.Exception.Message)" | |
| $failedUrls += $item.url | |
| } | |
| } | |
| # Test releases (GitHub API based) | |
| foreach($item in $json.releases) { | |
| $totalUrls++ | |
| $testCount++ | |
| Write-Host "Testing releases $testCount - $($item.file)" | |
| try { | |
| $repoUrl = "https://api.github.com/repos/$($item.repo)/releases/latest" | |
| $response = Invoke-WebRequest -Uri $repoUrl -Method Head -UseBasicParsing -TimeoutSec 15 | |
| Write-Host "SUCCESS $($item.file) - repo accessible" | |
| $successCount++ | |
| } catch { | |
| Write-Host "FAILED $($item.file) - $($_.Exception.Message)" | |
| $failedUrls += "https://github.com/$($item.repo)" | |
| } | |
| } | |
| # Test other downloads | |
| foreach($item in $json.other_downloads) { | |
| $totalUrls++ | |
| $testCount++ | |
| Write-Host "Testing other $testCount - $($item.file)" | |
| try { | |
| $response = Invoke-WebRequest -Uri $item.url -Method Head -UseBasicParsing -TimeoutSec 15 | |
| Write-Host "SUCCESS $($item.file)" | |
| $successCount++ | |
| } catch { | |
| Write-Host "FAILED $($item.file) - $($_.Exception.Message)" | |
| $failedUrls += $item.url | |
| } | |
| } | |
| # Test extra NES games | |
| foreach($item in $json.extra_nes_games) { | |
| $totalUrls++ | |
| $testCount++ | |
| Write-Host "Testing NES game $testCount - $($item.file)" | |
| try { | |
| $response = Invoke-WebRequest -Uri $item.url -Method Head -UseBasicParsing -TimeoutSec 15 | |
| Write-Host "SUCCESS $($item.file)" | |
| $successCount++ | |
| } catch { | |
| Write-Host "FAILED $($item.file) - $($_.Exception.Message)" | |
| $failedUrls += $item.url | |
| } | |
| } | |
| Write-Host "" | |
| Write-Host "SUMMARY: $successCount/$totalUrls URLs validated successfully" | |
| if($failedUrls.Count -gt 0) { | |
| Write-Host "WARNING - $($failedUrls.Count) URLs failed validation" | |
| Write-Host "Failed URLs may cause installation issues" | |
| } else { | |
| Write-Host "SUCCESS - All URLs are accessible" | |
| } | |
| shell: powershell | |
| - name: Test script syntax | |
| run: | | |
| Write-Host "Validating PowerShell script syntax..." | |
| try { | |
| $null = [System.Management.Automation.PSParser]::Tokenize((Get-Content "prepare.ps1" -Raw), [ref]$null) | |
| Write-Host "SUCCESS - PowerShell syntax is valid" | |
| } catch { | |
| Write-Host "ERROR - PowerShell syntax error: $($_.Exception.Message)" | |
| exit 1 | |
| } | |
| shell: powershell | |
| - name: Test JSON validity | |
| run: | | |
| Write-Host "Validating JSON configuration..." | |
| try { | |
| $json = Get-Content "download_list.json" | ConvertFrom-Json | |
| Write-Host "SUCCESS - JSON syntax is valid" | |
| Write-Host "Downloads: $($json.downloads.Count) items" | |
| Write-Host "Releases: $($json.releases.Count) items" | |
| Write-Host "Other downloads: $($json.other_downloads.Count) items" | |
| } catch { | |
| Write-Host "ERROR - JSON syntax error: $($_.Exception.Message)" | |
| exit 1 | |
| } | |
| shell: powershell | |
| - name: Run setup script (dry run) | |
| run: | | |
| Write-Host "This would normally run the full setup script." | |
| Write-Host "Skipping actual installation in CI environment to avoid timeouts." | |
| Write-Host "Script validation completed successfully!" | |
| shell: powershell |