7676 - name : Setup .NET
7777 uses : actions/setup-dotnet@v5
7878 with :
79- dotnet-version : ' 8 .0.x'
79+ dotnet-version : ' 10 .0.x'
8080
8181 - name : Restore dependencies
8282 run : dotnet restore
@@ -124,22 +124,55 @@ jobs:
124124 - name : Setup .NET
125125 uses : actions/setup-dotnet@v5
126126 with :
127- dotnet-version : ' 8 .0.x'
127+ dotnet-version : ' 10 .0.x'
128128
129- - name : Download all build artifacts
130- uses : actions/download-artifact@v5
131- with :
132- name : PSBinaryModule
133- path : build/out/PSBinaryModule
129+ - name : Build Module
130+ shell : pwsh
131+ run : |
132+ dotnet restore './PSBinaryModule.sln'
133+ dotnet build './PSBinaryModule.sln' --configuration Release --no-restore
134+
135+ if (Get-Command Invoke-Build -ErrorAction SilentlyContinue) {
136+ Invoke-Build -Task Build -Configuration Release
137+ } else {
138+ Install-Module InvokeBuild -Force -SkipPublisherCheck
139+ Invoke-Build -Task Build -Configuration Release
140+ }
141+
142+ - name : Install PowerShell
143+ shell : pwsh
144+ run : |
145+ if ($env:RUNNER_OS -eq 'Linux') {
146+ sudo apt-get update
147+ sudo apt-get install -y powershell
148+ } elseif ($env:RUNNER_OS -eq 'macOS') {
149+ brew install --cask powershell
150+ }
134151
135- - name : Setup PowerShell
152+ - name : Install Pester
136153 shell : pwsh
137154 run : |
138- Install-PSResource -Name Pester -TrustRepository -AcceptLicense
155+ Install-Module Pester -Force -SkipPublisherCheck
156+
157+ - name : Configure .NET Environment
158+ shell : pwsh
159+ run : |
160+ $dotnetInfo = & dotnet --info
161+ $sdkPath = $dotnetInfo | Select-String "Base Path:" | ForEach-Object { $_.Line -replace '.*Base Path:\s*', '' }
162+ if ($sdkPath) {
163+ $dotnetRoot = Split-Path -Parent (Split-Path -Parent $sdkPath)
164+ echo "DOTNET_ROOT=$dotnetRoot" >> $env:GITHUB_ENV
165+ echo "DOTNET_MULTILEVEL_LOOKUP=1" >> $env:GITHUB_ENV
166+ Write-Host "DOTNET_ROOT set to: $dotnetRoot"
167+ }
139168
140169 - name : Run Integration Tests
141170 shell : pwsh
171+ env :
172+ DOTNET_ROOT : ${{ env.DOTNET_ROOT }}
173+ DOTNET_MULTILEVEL_LOOKUP : ${{ env.DOTNET_MULTILEVEL_LOOKUP }}
142174 run : |
175+ Import-Module Pester
143176 $config = New-PesterConfiguration @{
144177 Run = @{
145178 Path = './tests/Integration'
@@ -158,7 +191,6 @@ jobs:
158191 }
159192 }
160193 Invoke-Pester -Configuration $config
161-
162194 - name : Upload test results
163195 uses : actions/upload-artifact@v6
164196 if : always()
0 commit comments