From 698e00bae13b0b5fa537819ad828ab07ef267d7b Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Wed, 11 Nov 2026 06:51:04 +0100 Subject: [PATCH] feat(run-dotnet-tests)!: provision .NET 11 and retire the end-of-life .NET 9 SDK .NET 11 is generally available since 2026-11-10 and .NET 9 reached end of support the same day. Install 10.0.402 (LTS) and 11.0.100 (current) instead of 9.0.319 and 10.0.402, move the Microsoft.Testing.Platform fixture to net11.0, and update the pin test, the version-pin ledger and the README to the new pair. BREAKING CHANGE: the .NET 9 SDK and runtime are no longer installed. No caller in the organisation targets net9.0. Co-Authored-By: Claude Fable 5.2 --- .../tests/Example.Tests/Example.Tests.csproj | 2 +- .github/tests/test-dotnet-native-fixtures.sh | 20 +++++++++---------- .github/version-pins.json | 12 +++++------ .github/workflows/ci.yaml | 4 ++-- actions/run-dotnet-tests/README.md | 4 ++-- actions/run-dotnet-tests/action.yaml | 6 +++--- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/fixtures/run-dotnet-tests-mtp/tests/Example.Tests/Example.Tests.csproj b/.github/fixtures/run-dotnet-tests-mtp/tests/Example.Tests/Example.Tests.csproj index 2950a982..79264e6d 100644 --- a/.github/fixtures/run-dotnet-tests-mtp/tests/Example.Tests/Example.Tests.csproj +++ b/.github/fixtures/run-dotnet-tests-mtp/tests/Example.Tests/Example.Tests.csproj @@ -1,7 +1,7 @@ - net10.0 + net11.0 Exe enable enable diff --git a/.github/tests/test-dotnet-native-fixtures.sh b/.github/tests/test-dotnet-native-fixtures.sh index 679d6104..e2b1d250 100644 --- a/.github/tests/test-dotnet-native-fixtures.sh +++ b/.github/tests/test-dotnet-native-fixtures.sh @@ -71,9 +71,9 @@ check_sdks() { ($probe|length)==1 and ($probe[0]|mandatory) and $probe[0].shell=="bash" and ($probe[0].env.SDK_VERSIONS|tostring|split("\n")|map(select(length>0)))==$versions and ($mapping[0]|mandatory) and ($blocks[0]|mandatory) and ($versions|length)==2 and - ($versions[0]|test("^9[.]0[.][0-9]+$")) and - ($versions[1]|test("^10[.]0[.][0-9]+$")) and - ($mapping[0]|versions)==[$versions[1]] and + ($versions[0]|test("^10[.]0[.][0-9]+$")) and + ($versions[1]|test("^11[.]0[.][0-9]+$")) and + ($mapping[0]|versions)==[$versions[0]] and ($blocks[0]|versions)==$versions ' "$1" >/dev/null } @@ -84,12 +84,12 @@ check_sdks "$work/ci.json" "$work/sdk.json" || { } sdk_controls=0 for mutation in \ - '.runs.steps[1].with["dotnet-version"]="9\n10"' \ - '.runs.steps[1].with["dotnet-version"]="9.0.x\n10.0.x"' \ - '.runs.steps[1].with["dotnet-version"]="9.0.319"' \ + '.runs.steps[1].with["dotnet-version"]="10\n11"' \ + '.runs.steps[1].with["dotnet-version"]="10.0.x\n11.0.x"' \ + '.runs.steps[1].with["dotnet-version"]="11.0.100"' \ '.runs.steps[1].with["dotnet-version"]="10.0.402"' \ - '.runs.steps[1].with["dotnet-version"]="9.0.319\n10.0.402-preview.1"' \ - '.runs.steps[0].env.SDK_VERSIONS="9.0.319"' \ + '.runs.steps[1].with["dotnet-version"]="10.0.402\n11.0.100-preview.1"' \ + '.runs.steps[0].env.SDK_VERSIONS="10.0.402"' \ '.runs.steps[0].if="false"' \ 'del(.runs.steps[0])' \ '.runs.steps[1].if="false"' \ @@ -107,9 +107,9 @@ done for mutation in \ '.jobs["test-run-dotnet-tests-preserves-source-mapping"].steps |= map(if (.uses // "" | startswith("actions/setup-dotnet@")) then .with["dotnet-version"]="10" else . end)' \ '.jobs["test-run-dotnet-tests-blocks"].steps |= map(select((.uses // "" | startswith("actions/setup-dotnet@")) | not))' \ - '.jobs["test-run-dotnet-tests-blocks"].steps |= map(if (.uses // "" | startswith("actions/setup-dotnet@")) then .with["dotnet-version"]="9.0.318\n10.0.402" else . end)' \ + '.jobs["test-run-dotnet-tests-blocks"].steps |= map(if (.uses // "" | startswith("actions/setup-dotnet@")) then .with["dotnet-version"]="10.0.401\n11.0.100" else . end)' \ '.jobs["test-run-dotnet-tests-preserves-source-mapping"].steps += [{uses:"actions/setup-dotnet@v4",with:{"dotnet-version":"10.0.402"}}]' \ - '.jobs["test-run-dotnet-tests-blocks"].steps += [{uses:"actions/setup-dotnet@v4",with:{"dotnet-version":"9.0.319\n10.0.402"}}]'; do + '.jobs["test-run-dotnet-tests-blocks"].steps += [{uses:"actions/setup-dotnet@v4",with:{"dotnet-version":"10.0.402\n11.0.100"}}]'; do jq "$mutation" "$work/ci.json" >"$work/broken-sdk-ci.json" if check_sdks "$work/broken-sdk-ci.json" "$work/sdk.json"; then echo 'FAIL: accepted missing, floating or mismatched fixture SDKs' >&2 diff --git a/.github/version-pins.json b/.github/version-pins.json index 8769b764..9aad6d5f 100644 --- a/.github/version-pins.json +++ b/.github/version-pins.json @@ -65,15 +65,15 @@ "files": [ "actions/run-dotnet-tests/action.yaml" ], - "refresh": "The .NET SDKs: previous STS and current LTS, exact published versions. Move actions/run-dotnet-tests and the native fixture steps in ci.yaml together." + "refresh": "The .NET SDKs: current LTS and current STS, exact published versions. Move actions/run-dotnet-tests and the native fixture steps in ci.yaml together." }, { "kind": "tool", - "pin": "SDK_VERSIONS: 9.0.319", + "pin": "SDK_VERSIONS: 11.0.100", "files": [ "actions/run-dotnet-tests/action.yaml" ], - "refresh": "The .NET SDKs: previous STS and current LTS, exact published versions. Move actions/run-dotnet-tests and the native fixture steps in ci.yaml together." + "refresh": "The .NET SDKs: current LTS and current STS, exact published versions. Move actions/run-dotnet-tests and the native fixture steps in ci.yaml together." }, { "kind": "tool", @@ -82,16 +82,16 @@ ".github/workflows/ci.yaml", "actions/run-dotnet-tests/action.yaml" ], - "refresh": "The .NET SDKs: previous STS and current LTS, exact published versions. Move actions/run-dotnet-tests and the native fixture steps in ci.yaml together." + "refresh": "The .NET SDKs: current LTS and current STS, exact published versions. Move actions/run-dotnet-tests and the native fixture steps in ci.yaml together." }, { "kind": "tool", - "pin": "dotnet-version: 9.0.319", + "pin": "dotnet-version: 11.0.100", "files": [ ".github/workflows/ci.yaml", "actions/run-dotnet-tests/action.yaml" ], - "refresh": "The .NET SDKs: previous STS and current LTS, exact published versions. Move actions/run-dotnet-tests and the native fixture steps in ci.yaml together." + "refresh": "The .NET SDKs: current LTS and current STS, exact published versions. Move actions/run-dotnet-tests and the native fixture steps in ci.yaml together." }, { "kind": "tool", diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 45d60b18..b55e07e8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1943,10 +1943,10 @@ jobs: - name: ⚙️ Setup .NET uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: - # Match actions/run-dotnet-tests/action.yaml's SDK provisioning (previous STS + current LTS). + # Match actions/run-dotnet-tests/action.yaml's SDK provisioning (current LTS + current STS). dotnet-version: | - 9.0.319 10.0.402 + 11.0.100 # Mirror actions/run-dotnet-tests/action.yaml's test step (`dotnet test …`) against a fixture # whose only test fails on purpose, so the run exits non-zero — exactly the gate's diff --git a/actions/run-dotnet-tests/README.md b/actions/run-dotnet-tests/README.md index 33fc7ce2..03da4f17 100644 --- a/actions/run-dotnet-tests/README.md +++ b/actions/run-dotnet-tests/README.md @@ -1,6 +1,6 @@ # Run Dotnet Tests -Test .NET solutions or projects across multiple platforms with code coverage reporting. Sets up the .NET 9 (STS) and .NET 10 (LTS) SDKs side-by-side, optionally restores private packages from GitHub Packages without persisting credentials, runs tests with coverage collection, and uploads the report to **GitHub Code Quality** (native PR coverage) on authenticated runs. +Test .NET solutions or projects across multiple platforms with code coverage reporting. Sets up the .NET 10 (LTS) and .NET 11 (STS) SDKs side-by-side, optionally restores private packages from GitHub Packages without persisting credentials, runs tests with coverage collection, and uploads the report to **GitHub Code Quality** (native PR coverage) on authenticated runs. > **Permissions:** the calling job must grant `code-quality: write` for the GitHub Code Quality upload. The coverage is merged into a single Cobertura report (via ReportGenerator) and uploaded once, from the Linux matrix leg only. The upload is best-effort (it never fails the build), requires the repo's **Code Quality** to be enabled (_Settings → Code quality_), and is skipped when `github-token` is empty. @@ -36,7 +36,7 @@ steps: The action picks the test command from the runner your project uses: - **VSTest (the default):** runs `dotnet test` with the Coverlet collector (`--collect:"XPlat Code Coverage"`). -- **Microsoft.Testing.Platform:** used when the nearest `global.json` sets `"test": { "runner": "Microsoft.Testing.Platform" }`. This is the runner xUnit v3 4.x needs on the .NET 10 SDK. +- **Microsoft.Testing.Platform:** used when the nearest `global.json` sets `"test": { "runner": "Microsoft.Testing.Platform" }`. This is the runner xUnit v3 4.x needs on the .NET 10 SDK and later. - If a project references `Microsoft.Testing.Extensions.CodeCoverage`, coverage is collected in Cobertura format with `--coverage`. - Otherwise tests still run, and a notice explains that coverage was skipped. diff --git a/actions/run-dotnet-tests/action.yaml b/actions/run-dotnet-tests/action.yaml index 30ff8ad0..8faa171d 100644 --- a/actions/run-dotnet-tests/action.yaml +++ b/actions/run-dotnet-tests/action.yaml @@ -19,8 +19,8 @@ runs: env: # Keep this list aligned with Setup .NET and the native fixture callsites. SDK_VERSIONS: | - 9.0.319 10.0.402 + 11.0.100 run: | set -euo pipefail count=0 @@ -45,12 +45,12 @@ runs: if: steps.sdk-check.outputs.install-needed != 'false' uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: - # Provision both the previous STS (9) and the current LTS (10) so callers can + # Provision both the current LTS (10) and the current STS (11) so callers can # target either TFM. Exact published SDKs avoid premature channel redirects. # Refresh these pins together with the two native fixture setup steps. dotnet-version: | - 9.0.319 10.0.402 + 11.0.100 - name: 🚚 Restore packages with GitHub Packages if: inputs.github-token != '' run: |