fix: keep shared CDP service available when disabling Phone Link #50
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 | |
| on: | |
| push: | |
| paths: | |
| - "app/resources/**" | |
| - "app/tools/**" | |
| - "app/licenses/**" | |
| - "app/Cargo.lock" | |
| - "playbook/**" | |
| - "tools/**" | |
| - "tests/**" | |
| - "docs/catalog/**" | |
| - ".github/workflows/**" | |
| - ".github/linters/**" | |
| - ".gitattributes" | |
| pull_request: | |
| paths: | |
| - "app/resources/**" | |
| - "app/tools/**" | |
| - "app/licenses/**" | |
| - "app/Cargo.lock" | |
| - "playbook/**" | |
| - "tools/**" | |
| - "tests/**" | |
| - "docs/catalog/**" | |
| - ".github/workflows/**" | |
| - ".github/linters/**" | |
| - ".gitattributes" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: windows-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout code | |
| # gh api repos/actions/checkout/commits/v7.0.0 --jq '.sha' | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Windows PowerShell 5.1 parse gate | |
| # The payload runs under Windows PowerShell 5.1 on target machines; this catches | |
| # PowerShell-7-only syntax before it ships. Includes .psd1 so a broken tweak | |
| # definition or module manifest cannot ship and fail (or get skipped) at runtime. | |
| shell: powershell | |
| run: | | |
| $failed = $false | |
| Get-ChildItem -Path 'playbook','app/resources' -Recurse -Include '*.ps1','*.psm1','*.psd1' | ForEach-Object { | |
| $tokens = $null | |
| $errors = $null | |
| [System.Management.Automation.Language.Parser]::ParseFile($_.FullName, [ref]$tokens, [ref]$errors) | Out-Null | |
| if ($errors) { | |
| $failed = $true | |
| foreach ($parseError in $errors) { | |
| Write-Host "::error file=$($_.FullName),line=$($parseError.Extent.StartLineNumber)::$($parseError.Message)" | |
| } | |
| } | |
| } | |
| if ($failed) { exit 1 } | |
| Write-Host "All payload and app resource scripts parse under Windows PowerShell 5.1." | |
| - name: Install Pester | |
| shell: pwsh | |
| run: | | |
| # Pinned for reproducible results | |
| if (-not (Get-Module -ListAvailable Pester | Where-Object Version -eq '5.7.1')) { | |
| Install-Module -Name Pester -RequiredVersion 5.7.1 -Force -Scope CurrentUser | |
| } | |
| - name: Test PowerShell 7 build tooling | |
| shell: pwsh | |
| run: | | |
| Import-Module Pester -RequiredVersion 5.7.1 | |
| $config = New-PesterConfiguration | |
| $config.Run.Path = @('tests\AtlasBuild.Tests.ps1', 'app\tools\tests') | |
| $config.Run.Exit = $true | |
| $config.Output.Verbosity = 'Normal' | |
| Invoke-Pester -Configuration $config | |
| - name: Install Pester (Windows PowerShell 5.1) | |
| shell: powershell | |
| run: | | |
| # Pinned for reproducible results; -SkipPublisherCheck because the inbox | |
| # Pester 3.4 signature differs from the gallery module's. | |
| if (-not (Get-Module -ListAvailable Pester | Where-Object Version -eq '5.7.1')) { | |
| Install-Module -Name Pester -RequiredVersion 5.7.1 -Force -Scope CurrentUser -SkipPublisherCheck | |
| } | |
| - name: Test the Windows PowerShell 5.1 payload | |
| shell: powershell | |
| run: | | |
| Import-Module Pester -RequiredVersion 5.7.1 | |
| $config = New-PesterConfiguration | |
| $config.Run.Path = 'tests' | |
| $config.Run.ExcludePath = (Resolve-Path 'tests\AtlasBuild.Tests.ps1').Path | |
| $config.Run.Exit = $true | |
| $config.Output.Verbosity = 'Normal' | |
| Invoke-Pester -Configuration $config |