chore(ci): move unit tests and build to Docker containers on self-hosted runner

All CI now runs on the self-hosted runner using Docker containers,
eliminating GitHub-hosted runner minute consumption:

- Unit tests: PS 7.5 container (mcr.microsoft.com/powershell:7.5-ubuntu-24.04)
  with .NET SDK 9.0 installed at build time
- Build/xUnit: .NET SDK 9.0 container (mcr.microsoft.com/dotnet/sdk:9.0)
- Integration tests: unchanged (runs directly on self-hosted runner)

Drops net48/PS 5.1 CI matrix (Windows-only, can't run in Linux
containers). Local Docker testing available via tests/Dockerfile.test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-19 08:56:12 -05:00
parent 7962a549f0
commit 558053dc74
3 changed files with 69 additions and 121 deletions
+12 -33
View File
@@ -7,49 +7,28 @@ on:
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-and-test:
runs-on: [self-hosted, proxmox, integration]
timeout-minutes: 15
container:
image: mcr.microsoft.com/dotnet/sdk:9.0
options: --user root
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
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-net9-${{ matrix.os }}
name: coverage-net9
path: ./coverage