Files
PSProxmoxVE/.github/workflows/build.yml
T
Clint Branham ec05e52e58 fix(ci): fix xunit test, net48 build isolation, mock server check, Pester config
- Update BaseUrl test to expect trailing slash (matches code change)
- Revert upload-artifact to v4 (v5 doesn't exist yet)
- Build net48 job restores only src/test projects (excludes MockServer)
- MockServer.Tests.ps1: fix net10.0 -> net9.0 DLL paths, fix build check
- Unit tests: use New-PesterConfiguration instead of -CI flag (fixes
  AmbiguousParameterSet on PS 5.1), exclude MockIntegration tag

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 17:20:39 -05:00

56 lines
2.0 KiB
YAML

name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-net48:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: |
dotnet restore src/PSProxmoxVE/PSProxmoxVE.csproj
dotnet restore tests/PSProxmoxVE.Core.Tests/PSProxmoxVE.Core.Tests.csproj
- name: Build net48
run: |
dotnet build src/PSProxmoxVE/PSProxmoxVE.csproj --configuration Release --framework net48 --no-restore
dotnet build tests/PSProxmoxVE.Core.Tests/PSProxmoxVE.Core.Tests.csproj --configuration Release --framework net48 --no-restore
- name: Test net48
run: dotnet test tests/PSProxmoxVE.Core.Tests/PSProxmoxVE.Core.Tests.csproj --configuration Release --framework net48 --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-net48
path: ./coverage
build-net9:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build net9.0
run: dotnet build --configuration Release --framework net9.0 --no-restore
- name: Test net9.0
run: dotnet test tests/PSProxmoxVE.Core.Tests/PSProxmoxVE.Core.Tests.csproj --configuration Release --framework net9.0 --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-net9-${{ matrix.os }}
path: ./coverage