From e3b68d854aefe5d1e5bf690b60ac99074d97822a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 23:49:11 +0000 Subject: [PATCH 1/5] CI: run tests on Linux for .NET 8 and .NET 10 Gives OS x .NET version pairwise coverage. The reusable test workflow now skips Windows-only msbuild setup and builds Tests.csproj directly on Linux (the slnf pulls in the Web esproj, which the tests don't need). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019FEr8DKN7HXRmh5ejKjfRE --- .github/workflows/dotnet-tests.yml | 12 +++++++++++- .github/workflows/dotnet.yml | 12 ++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-tests.yml b/.github/workflows/dotnet-tests.yml index 0fe9bc6f9..b04178892 100644 --- a/.github/workflows/dotnet-tests.yml +++ b/.github/workflows/dotnet-tests.yml @@ -7,7 +7,9 @@ on: required: true type: string vs-version: - required: true + description: Visual Studio version range for msbuild; only used on Windows runners + required: false + default: '' type: string dotnet-version: required: true @@ -25,19 +27,27 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} - name: Add msbuild to PATH + if: runner.os == 'Windows' uses: microsoft/setup-msbuild@v2 with: vs-version: ${{ inputs.vs-version }} - name: Build + if: runner.os == 'Windows' run: dotnet build DotNetBuildable.slnf /p:Configuration=Release + # The slnf includes the Web .esproj (needs node/npm); the tests don't need it + - name: Build (non-Windows) + if: runner.os != 'Windows' + run: dotnet build Tests/Tests.csproj -c Release -f net${{ inputs.dotnet-version == '8.0.x' && '8.0' || '10.0' }} + - name: Create global.json to enforce .NET 8 for MSBuild and update Tests/TestData projects if: inputs.dotnet-version == '8.0.x' shell: pwsh run: ./.github/scripts/update-testdata-targetframework.ps1 - name: Log MSBuild version + if: runner.os == 'Windows' run: msbuild -version - name: Log .NET version diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index c7dd3661f..9e20f7c00 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -85,3 +85,15 @@ jobs: runs-on: windows-2025-vs2026 vs-version: '[18.0,)' dotnet-version: 10.0.x + + test-linux-net8: + uses: ./.github/workflows/dotnet-tests.yml + with: + runs-on: ubuntu-24.04 + dotnet-version: 8.0.x + + test-linux-net10: + uses: ./.github/workflows/dotnet-tests.yml + with: + runs-on: ubuntu-24.04 + dotnet-version: 10.0.x From 2bb3557e680043a6017f6f129d8a7c9943d24007 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 23:51:05 +0000 Subject: [PATCH 2/5] CI: drop Linux net10 job; Windows already covers net10 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019FEr8DKN7HXRmh5ejKjfRE --- .github/workflows/dotnet.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9e20f7c00..fd3cdee46 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -91,9 +91,3 @@ jobs: with: runs-on: ubuntu-24.04 dotnet-version: 8.0.x - - test-linux-net10: - uses: ./.github/workflows/dotnet-tests.yml - with: - runs-on: ubuntu-24.04 - dotnet-version: 10.0.x From b3538470dbbc17871f27386060e9ff11f1aea4e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 23:55:08 +0000 Subject: [PATCH 3/5] CI: test latest on Windows only, previous on Linux only Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019FEr8DKN7HXRmh5ejKjfRE --- .github/workflows/dotnet.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fd3cdee46..23b910ef8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -72,13 +72,6 @@ jobs: name: ICSharpCode.CodeConverter.Func.${{ env.BuildVersion }}.zip path: Func/bin/${{ env.BuildTarget }}/publish/ - test-vs2022: - uses: ./.github/workflows/dotnet-tests.yml - with: - runs-on: windows-2022 - vs-version: '[17.0,18.0)' - dotnet-version: 8.0.x - test-vs2026: uses: ./.github/workflows/dotnet-tests.yml with: From 7c146f9582b7c6a045488abf6ec572fccab7b6aa Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 23:58:47 +0000 Subject: [PATCH 4/5] CI: test jobs depend only on the .NET version, not Visual Studio Drops setup-msbuild/vs-version and uses windows-latest/ubuntu-latest. Both OSes build and test Tests.csproj for the matching framework. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019FEr8DKN7HXRmh5ejKjfRE --- .github/workflows/dotnet-tests.yml | 32 +++++++----------------------- .github/workflows/dotnet.yml | 9 ++++----- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/.github/workflows/dotnet-tests.yml b/.github/workflows/dotnet-tests.yml index b04178892..558a32231 100644 --- a/.github/workflows/dotnet-tests.yml +++ b/.github/workflows/dotnet-tests.yml @@ -6,11 +6,6 @@ on: runs-on: required: true type: string - vs-version: - description: Visual Studio version range for msbuild; only used on Windows runners - required: false - default: '' - type: string dotnet-version: required: true type: string @@ -18,6 +13,9 @@ on: jobs: test: runs-on: ${{ inputs.runs-on }} + env: + # Tests only need the matching target framework; the slnf also builds the Web project, which needs node + TestFramework: net${{ inputs.dotnet-version == '8.0.x' && '8.0' || '10.0' }} steps: - uses: actions/checkout@v4 @@ -26,32 +24,16 @@ jobs: with: dotnet-version: ${{ inputs.dotnet-version }} - - name: Add msbuild to PATH - if: runner.os == 'Windows' - uses: microsoft/setup-msbuild@v2 - with: - vs-version: ${{ inputs.vs-version }} - - - name: Build - if: runner.os == 'Windows' - run: dotnet build DotNetBuildable.slnf /p:Configuration=Release - - # The slnf includes the Web .esproj (needs node/npm); the tests don't need it - - name: Build (non-Windows) - if: runner.os != 'Windows' - run: dotnet build Tests/Tests.csproj -c Release -f net${{ inputs.dotnet-version == '8.0.x' && '8.0' || '10.0' }} - - name: Create global.json to enforce .NET 8 for MSBuild and update Tests/TestData projects if: inputs.dotnet-version == '8.0.x' shell: pwsh run: ./.github/scripts/update-testdata-targetframework.ps1 - - name: Log MSBuild version - if: runner.os == 'Windows' - run: msbuild -version - - name: Log .NET version run: dotnet --info + - name: Build + run: dotnet build Tests/Tests.csproj -c Release -f ${{ env.TestFramework }} + - name: Execute unit tests - run: dotnet test Tests/Tests.csproj -c Release --framework net${{ inputs.dotnet-version == '8.0.x' && '8.0' || '10.0' }} --no-build + run: dotnet test Tests/Tests.csproj -c Release -f ${{ env.TestFramework }} --no-build diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 23b910ef8..bfd8057cc 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -72,15 +72,14 @@ jobs: name: ICSharpCode.CodeConverter.Func.${{ env.BuildVersion }}.zip path: Func/bin/${{ env.BuildTarget }}/publish/ - test-vs2026: + test-windows-latest: uses: ./.github/workflows/dotnet-tests.yml with: - runs-on: windows-2025-vs2026 - vs-version: '[18.0,)' + runs-on: windows-latest dotnet-version: 10.0.x - test-linux-net8: + test-linux-previous: uses: ./.github/workflows/dotnet-tests.yml with: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest dotnet-version: 8.0.x From 641781abcf342fc55db82a757137fed23d0c3c6c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 23:59:39 +0000 Subject: [PATCH 5/5] CI: build before pinning SDK 8 for tests; use valid global.json version The projects also target net10.0, so the build needs the newest SDK (as before the refactor). SDK 8 is only pinned for the test run. 8.0.0 is rejected by newer hosts as an SDK version (feature bands start at 100). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019FEr8DKN7HXRmh5ejKjfRE --- .github/scripts/update-testdata-targetframework.ps1 | 2 +- .github/workflows/dotnet-tests.yml | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/scripts/update-testdata-targetframework.ps1 b/.github/scripts/update-testdata-targetframework.ps1 index 67f6ef00c..c37fdbf55 100644 --- a/.github/scripts/update-testdata-targetframework.ps1 +++ b/.github/scripts/update-testdata-targetframework.ps1 @@ -3,7 +3,7 @@ param() $ErrorActionPreference = 'Stop' Write-Host "Creating global.json to enforce .NET 8 for MSBuild" -$globalJson = '{"sdk":{"version":"8.0.0","rollForward":"latestFeature"}}' +$globalJson = '{"sdk":{"version":"8.0.100","rollForward":"latestFeature"}}' [System.IO.File]::WriteAllText('global.json', $globalJson, [System.Text.Encoding]::UTF8) Write-Host "Searching for project files under Tests/TestData..." diff --git a/.github/workflows/dotnet-tests.yml b/.github/workflows/dotnet-tests.yml index 558a32231..685c387d6 100644 --- a/.github/workflows/dotnet-tests.yml +++ b/.github/workflows/dotnet-tests.yml @@ -24,16 +24,17 @@ jobs: with: dotnet-version: ${{ inputs.dotnet-version }} - - name: Create global.json to enforce .NET 8 for MSBuild and update Tests/TestData projects - if: inputs.dotnet-version == '8.0.x' - shell: pwsh - run: ./.github/scripts/update-testdata-targetframework.ps1 - - name: Log .NET version run: dotnet --info + # Build with the newest SDK (the projects also target net10.0); only the test run is pinned to SDK 8 - name: Build run: dotnet build Tests/Tests.csproj -c Release -f ${{ env.TestFramework }} + - name: Create global.json to enforce .NET 8 for MSBuild and update Tests/TestData projects + if: inputs.dotnet-version == '8.0.x' + shell: pwsh + run: ./.github/scripts/update-testdata-targetframework.ps1 + - name: Execute unit tests run: dotnet test Tests/Tests.csproj -c Release -f ${{ env.TestFramework }} --no-build