Update workflow for release notes #55
Workflow file for this run
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: Pester Tests | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| pester-tests: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install PowerShell Module Dependencies | |
| shell: pwsh | |
| run: | | |
| Set-PSRepository PSGallery -InstallationPolicy Trusted | |
| Install-Module -Name Pester -Force -SkipPublisherCheck | |
| Install-Module -Name PowerShell-Yaml -Force -SkipPublisherCheck | |
| - name: Install pandoc | |
| shell: pwsh | |
| run: | | |
| choco install pandoc -y | |
| - name: Run Pester Tests | |
| shell: pwsh | |
| run: | | |
| # Debug: Show current directory and files | |
| Write-Host "Current directory: $(Get-Location)" | |
| Write-Host "Directory structure:" | |
| Get-ChildItem -Path . -Recurse | Select-Object FullName, PSIsContainer | |
| # Change to src directory to match test expectations | |
| Set-Location "./src" | |
| Write-Host "Changed to src directory: $(Get-Location)" | |
| # Configure Pester | |
| $PesterConfig = @{ | |
| Run = @{ | |
| Path = './tests' | |
| } | |
| Output = @{ | |
| Verbosity = 'Detailed' | |
| } | |
| TestResult = @{ | |
| Enabled = $true | |
| OutputPath = '../TestResults.xml' | |
| OutputFormat = 'NUnitXml' | |
| } | |
| CodeCoverage = @{ | |
| Enabled = $true | |
| Path = './*.ps*1' | |
| OutputPath = '../coverage.xml' | |
| OutputFormat = 'JaCoCo' | |
| } | |
| } | |
| # Run tests | |
| $Results = Invoke-Pester -Configuration $PesterConfig | |
| # Change back to root directory | |
| Set-Location ".." | |
| # Exit with error code if tests failed | |
| if ($Results.FailedCount -gt 0) { | |
| Write-Error "Tests failed: $($Results.FailedCount) failed out of $($Results.TotalCount) total tests" | |
| exit 1 | |
| } | |
| Write-Host "All tests passed: $($Results.PassedCount) out of $($Results.TotalCount) tests" | |
| # - name: Publish Test Results | |
| # uses: dorny/test-reporter@v1 | |
| # if: always() | |
| # with: | |
| # name: Pester Tests | |
| # path: TestResults.xml | |
| # reporter: java-junit | |
| # fail-on-error: true | |
| # - name: Upload Test Results | |
| # uses: actions/upload-artifact@v4 | |
| # if: always() | |
| # with: | |
| # name: test-results | |
| # path: | | |
| # TestResults.xml | |
| # coverage.xml | |
| # retention-days: 7 |