Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/update-testdata-targetframework.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/dotnet-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ on:
runs-on:
required: true
type: string
vs-version:
required: true
type: string
dotnet-version:
required: true
type: string

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
Expand All @@ -24,24 +24,17 @@ jobs:
with:
dotnet-version: ${{ inputs.dotnet-version }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: ${{ inputs.vs-version }}
- 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 DotNetBuildable.slnf /p:Configuration=Release
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: Log MSBuild version
run: msbuild -version

- name: Log .NET version
run: dotnet --info

- 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
14 changes: 6 additions & 8 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,14 @@ jobs:
name: ICSharpCode.CodeConverter.Func.${{ env.BuildVersion }}.zip
path: Func/bin/${{ env.BuildTarget }}/publish/

test-vs2022:
test-windows-latest:
uses: ./.github/workflows/dotnet-tests.yml
with:
runs-on: windows-2022
vs-version: '[17.0,18.0)'
dotnet-version: 8.0.x
runs-on: windows-latest
dotnet-version: 10.0.x

test-vs2026:
test-linux-previous:
uses: ./.github/workflows/dotnet-tests.yml
with:
runs-on: windows-2025-vs2026
vs-version: '[18.0,)'
dotnet-version: 10.0.x
runs-on: ubuntu-latest
dotnet-version: 8.0.x
Loading