fix: Add fetch-depth to workflow to resolve versioning error #2
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: Test Clear All Notifications URI | |
| on: push | |
| jobs: | |
| test_clear_all_notifications_uri: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout ClassIsland repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Checkout EdgeTtsSharp repository | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: ClassIsland/EdgeTtsSharp | |
| path: vendors/EdgeTtsSharp | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Build ClassIsland | |
| run: dotnet build ClassIsland/ClassIsland.csproj -c Release | |
| - name: Run ClassIsland | |
| run: Start-Process -FilePath "ClassIsland/bin/Release/net8.0-windows/ClassIsland.exe" | |
| - name: Wait for ClassIsland to start | |
| run: Start-Sleep -Seconds 10 | |
| - name: Call clearAllNotifications URI | |
| run: explorer "classisland://app/clearAllNotifications" | |
| - name: Wait for URI to be processed | |
| run: Start-Sleep -Seconds 5 | |
| - name: Verify notifications cleared in logs | |
| shell: pwsh | |
| run: | | |
| $logDir = "ClassIsland/bin/Release/net8.0-windows/Logs" | |
| Write-Host "Checking for logs in: $logDir" | |
| if (Test-Path $logDir) { | |
| $latestLog = Get-ChildItem -Path $logDir -Filter "*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 | |
| if ($latestLog) { | |
| Write-Host "Found log file: $($latestLog.FullName)" | |
| $logContent = Get-Content -Path $latestLog.FullName -Raw | |
| $expectedMessage = "All notifications successfully cancelled via CancelAllNotifications method." | |
| if ($logContent -match [regex]::Escape($expectedMessage)) { | |
| Write-Host "Success: Verification message found in log." | |
| } else { | |
| Write-Host "Error: Verification message NOT found in log." | |
| Write-Host "Log content:" | |
| Write-Host $logContent | |
| exit 1 | |
| } | |
| } else { | |
| Write-Host "Error: No log files found in $logDir" | |
| exit 1 | |
| } | |
| } else { | |
| Write-Host "Error: Log directory $logDir not found." | |
| exit 1 | |
| } |