Skip to content

docs(site): enable .NET API metadata generation — Step 10 (final) #151

docs(site): enable .NET API metadata generation — Step 10 (final)

docs(site): enable .NET API metadata generation — Step 10 (final) #151

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
- name: Restore
run: dotnet restore dotnet/Pal.sln
- name: Build
run: dotnet build dotnet/Pal.sln -c Release --no-restore
- name: Test
# Pal.Api.Tests is intentionally excluded — it requires Docker (Testcontainers), which is
# unavailable on Windows runners. Those tests run in api-integration-tests on ubuntu-latest.
# Enumerating projects (rather than --filter against the solution) avoids the per-DLL
# zero-match exit 1 behavior introduced by newer Microsoft.NET.Test.Sdk versions.
shell: pwsh
run: |
$projects = @(
'dotnet/tests/Pal.Engine.Tests',
'dotnet/tests/Pal.Packs.Tests',
'dotnet/tests/Pal.Ingestion.Tests',
'dotnet/tests/Pal.Reporting.Tests',
'dotnet/tests/Pal.Application.Tests',
'dotnet/tests/Pal.Cli.Tests'
)
foreach ($p in $projects) {
dotnet test $p -c Release --no-build --logger "console;verbosity=normal"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
- name: Validate packs
run: |
dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- validate-pack --path packs/thresholds/windows-core
dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- validate-pack --path packs/thresholds/iis-core
dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- validate-pack --path packs/thresholds/sql-host-core
- name: Validate broken pack exits 4
shell: bash
run: |
set +e
dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- validate-pack --path fixtures/broken-pack
actual=$?
if [ "$actual" -ne 4 ]; then echo "Expected exit code 4 for broken pack, got $actual"; exit 1; fi
- name: Run cpu-pressure fixture (determinism check 1)
run: dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- analyze --input fixtures/cpu-pressure/input.csv --output out/run1 --pack-dir packs/thresholds --now 2026-01-01T00:00:00Z
- name: Run cpu-pressure fixture (determinism check 2)
run: dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- analyze --input fixtures/cpu-pressure/input.csv --output out/run2 --pack-dir packs/thresholds --now 2026-01-01T00:00:00Z
- name: Assert deterministic output
run: |
$f1 = Get-Content out/run1/input.pal-report.json -Raw
$f2 = Get-Content out/run2/input.pal-report.json -Raw
if ($f1 -ne $f2) { Write-Error "Report outputs differ between runs — non-determinism detected"; exit 1 }
Write-Host "Determinism check passed"
shell: pwsh
- name: Run healthy-server fixture
run: dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- analyze --input fixtures/healthy-server/input.csv --output out/healthy --pack-dir packs/thresholds --now 2026-01-01T00:00:00Z
- name: Run disk-latency fixture
run: dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- analyze --input fixtures/disk-latency/input.csv --output out/disk --pack-dir packs/thresholds --now 2026-01-01T00:00:00Z
- name: Run memory-pressure fixture with host context
run: dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- analyze --input fixtures/memory-pressure/input.csv --output out/memory --pack-dir packs/thresholds --host-memory-mb 8192 --host-cpu-count 4 --now 2026-01-01T00:00:00Z
- name: Verify --html-only --json-only exits 2
shell: bash
run: |
set +e
dotnet run --project dotnet/src/Pal.Cli --no-build -c Release -- analyze --input fixtures/cpu-pressure/input.csv --output out/bad --html-only --json-only
actual=$?
if [ "$actual" -ne 2 ]; then echo "Expected exit code 2, got $actual"; exit 1; fi
api-integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"
- name: Restore
run: dotnet restore dotnet/Pal.sln
- name: Build
run: dotnet build dotnet/tests/Pal.Api.Tests/Pal.Api.Tests.csproj -c Release --no-restore
- name: Test
run: dotnet test dotnet/tests/Pal.Api.Tests/Pal.Api.Tests.csproj -c Release --no-build --logger "console;verbosity=normal"
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Build API image
run: docker build -f infra/docker/api.Dockerfile -t pal-api:ci .