Collect a hang dump on the wedging Windows PowerShell CI leg #1276
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: CI Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| actions: read | |
| jobs: | |
| ci: | |
| name: dotnet | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ windows-latest, macos-latest, ubuntu-latest ] | |
| runs-on: ${{ matrix.os }} | |
| # A normal run finishes in well under an hour (Windows, the slowest, is | |
| # ~12-14 minutes); this caps a hung test instead of letting it ride | |
| # GitHub's 6-hour default. | |
| timeout-minutes: 60 | |
| env: | |
| DOTNET_NOLOGO: true | |
| DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Install dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| cache: true | |
| cache-dependency-path: '**/*.csproj' | |
| global-json-file: ./global.json | |
| - name: Install PSResources | |
| shell: pwsh | |
| run: ./tools/installPSResources.ps1 | |
| - name: Download PowerShell install script | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: PowerShell/PowerShell | |
| path: pwsh | |
| sparse-checkout: tools/install-powershell.ps1 | |
| sparse-checkout-cone-mode: false | |
| - name: Install preview | |
| shell: pwsh | |
| run: ./pwsh/tools/install-powershell.ps1 -Preview -Destination ./preview | |
| - name: Install ProcDump for Windows PowerShell hang dumps | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| # VSTest's built-in hang dumper only handles .NET Core test hosts, so | |
| # capturing a dump of a wedged .NET Framework (net462 / Windows | |
| # PowerShell 5.1) test host requires ProcDump, which isn't on the | |
| # runner image. Install is best-effort: a failure must not fail CI | |
| # (the net8 legs dump without it, and `--blame-hang` still terminates | |
| # the host and writes a sequence file naming the hung test). See #2323. | |
| try { | |
| $zip = Join-Path $env:RUNNER_TEMP 'Procdump.zip' | |
| $dir = Join-Path $env:RUNNER_TEMP 'procdump' | |
| Invoke-WebRequest -Uri 'https://download.sysinternals.com/files/Procdump.zip' -OutFile $zip | |
| Expand-Archive -Path $zip -DestinationPath $dir -Force | |
| "PROCDUMP_PATH=$dir" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| Write-Host "ProcDump installed to $dir" | |
| } catch { | |
| Write-Warning "ProcDump install failed; net462 hang dumps will be unavailable: $_" | |
| } | |
| - name: Build and test | |
| shell: pwsh | |
| run: Invoke-Build -Configuration Release TestFull | |
| # - name: Start VS Code Tunnel if failed or in debug mode | |
| # if: ${{ failure() || runner.debug == '1' }} | |
| # #v0.0.2 - Pinned for security | |
| # uses: justingrote/vscode-action@5d495ef6156c20f1f9bb21031c15776d476c10c3 | |
| # with: | |
| # #All these settings are optional | |
| # tunnel-name: 'pses-action-tunnel' | |
| # connection-timeout: 2 | |
| # session-timeout: 30 | |
| # no-cache-cli-auth: true | |
| - name: Upload build artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: PowerShellEditorServices-module-${{ matrix.os }} | |
| path: module | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: PowerShellEditorServices-test-results-${{ matrix.os }} | |
| path: | | |
| **/*.trx | |
| **/*.dmp | |
| **/*_Sequence.xml |