diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index c2ac2ee2..a812892c 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -2,13 +2,21 @@ name: 'Run NRedisStack tests' description: 'Runs NRedisStack tests against different Redis versions and configurations' inputs: dotnet-version: - description: 'SDK version' + description: 'Target .NET version to build and run the tests against, i.e. "8.0" for net8.0' default: '10.0' required: false dotnet-quality: description: 'SDK quality' default: 'ga' required: false + build-sdk-version: + description: > + SDK version used to drive restore/build/pack, independent of the target + version above. Solution discovery of the .slnx needs an SDK >= 9.0.200, + so this must stay ahead of the oldest targeted version. Bump this when + the matrix starts targeting something newer than the SDK can build. + default: '10.0' + required: false redis-version: description: 'Redis version to test against (MAJOR.MINOR format, e.g., "7.4", "8.0")' required: false @@ -51,10 +59,13 @@ runs: repository: ${{ inputs.repository }} ref: ${{ inputs.ref }} + # We always build with build-sdk-version, but the target version is installed + # too so its runtime is present for `dotnet test -f `. - name: Install .NET Core uses: actions/setup-dotnet@v5 with: dotnet-version: | + ${{inputs.build-sdk-version}} ${{inputs.dotnet-version}} dotnet-quality: '${{inputs.dotnet-quality}}' @@ -99,15 +110,16 @@ runs: echo "::endgroup::" shell: bash - # Make sure only the desired dotnet version is set both as target and as active SDK. + # Narrow every project to the single target framework under test, and pin the + # active SDK to the build SDK (not the target version - the two are decoupled). - name: Tweak target frameworks env: - INPUT_DOTNET_VERSION: ${{ inputs.dotnet-version }} + INPUT_BUILD_SDK_VERSION: ${{ inputs.build-sdk-version }} shell: bash run: | find . -name '*.csproj' | xargs -I {} sed -E -i "s|.*|${CLR_VERSION}|" {} find . -name '*.csproj' | xargs cat - jq -n --arg version "$INPUT_DOTNET_VERSION" '{"sdk":{"version":$version,"rollForward":"latestMinor"}}' > global.json + jq -n --arg version "$INPUT_BUILD_SDK_VERSION" '{"sdk":{"version":$version,"rollForward":"latestMinor"}}' > global.json - name: Check .NET version shell: bash run: dotnet --version diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 06dad0f3..fe9a44b1 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -84,6 +84,12 @@ jobs: ENDPOINT: ${{ secrets.ENDPOINT }} steps: - uses: actions/checkout@v6 + # Pinned explicitly rather than relying on whatever the runner image + # ships: discovering the .slnx solution needs an SDK >= 9.0.200. + - name: Set up .NET 10 + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10 - uses: Vampire/setup-wsl@v6 with: distribution: Ubuntu-22.04 diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 5f40f3c1..fee1439b 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -13,12 +13,16 @@ jobs: dotnet-format: runs-on: windows-latest steps: - - name: Install dotnet-format - run: dotnet tool install -g dotnet-format - - name: Checkout repo uses: actions/checkout@v6 + # The SDK's built-in `dotnet format` is used rather than the legacy + # standalone dotnet-format tool, which cannot discover a .slnx solution. + - name: Set up .NET 10 + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 10 + - name: lint run: | dotnet format diff --git a/.github/workflows/nuget-release.yml b/.github/workflows/nuget-release.yml index 6311fdb1..c8849358 100644 --- a/.github/workflows/nuget-release.yml +++ b/.github/workflows/nuget-release.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - name: Set up .NET 9 + - name: Set up .NET 10 uses: actions/setup-dotnet@v5 with: - dotnet-version: 9 + dotnet-version: 10 - name: Check .NET version run: dotnet --version - name: Check .NET SDKs diff --git a/.vscode/settings.json b/.vscode/settings.json index 12b5a010..2f9c6232 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "dotnet-test-explorer.testArguments": "/p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info", "dotnet-test-explorer.testProjectPath": "**/*NRedisStack.Tests.csproj", - "dotnet.defaultSolution": "NRedisStack.sln", + "dotnet.defaultSolution": "NRedisStack.slnx", "dotnet.unitTests.runSettingsPath": ".vscode/.runsettings" } \ No newline at end of file diff --git a/NRedisStack.sln b/NRedisStack.sln deleted file mode 100644 index 975e6fed..00000000 --- a/NRedisStack.sln +++ /dev/null @@ -1,66 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30114.105 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRedisStack", "src\NRedisStack\NRedisStack.csproj", "{6F5E84A5-DFC1-4747-AF7D-97BDAFA9102D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRedisStack.Tests", "tests\NRedisStack.Tests\NRedisStack.Tests.csproj", "{73B56C35-BC92-4ACD-B077-7D55CD67B95F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Doc", "tests\Doc\Doc.csproj", "{F14F6342-14A0-4DDD-AB05-C425B1AD8001}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{84D6210F-9A65-427A-965F-57E7B76424AB}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - Directory.Packages.props = Directory.Packages.props - global.json = global.json - version.json = version.json - .github\actions\run-tests\action.yml = .github\actions\run-tests\action.yml - .github\workflows\integration.yml = .github\workflows\integration.yml - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docs", "docs\docs.csproj", "{4A35FC3C-69BC-4BDB-A4B2-6BFD0DF215AD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ci", ".github\ci.csproj", "{7524BE44-2B46-454F-80B5-BF131927D948}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dockers", "tests\dockers\dockers.csproj", "{7675B578-9759-4860-B9DC-31FECA809A42}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6F5E84A5-DFC1-4747-AF7D-97BDAFA9102D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6F5E84A5-DFC1-4747-AF7D-97BDAFA9102D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6F5E84A5-DFC1-4747-AF7D-97BDAFA9102D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F5E84A5-DFC1-4747-AF7D-97BDAFA9102D}.Release|Any CPU.Build.0 = Release|Any CPU - {73B56C35-BC92-4ACD-B077-7D55CD67B95F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73B56C35-BC92-4ACD-B077-7D55CD67B95F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73B56C35-BC92-4ACD-B077-7D55CD67B95F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73B56C35-BC92-4ACD-B077-7D55CD67B95F}.Release|Any CPU.Build.0 = Release|Any CPU - {F14F6342-14A0-4DDD-AB05-C425B1AD8001}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F14F6342-14A0-4DDD-AB05-C425B1AD8001}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F14F6342-14A0-4DDD-AB05-C425B1AD8001}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F14F6342-14A0-4DDD-AB05-C425B1AD8001}.Release|Any CPU.Build.0 = Release|Any CPU - {4A35FC3C-69BC-4BDB-A4B2-6BFD0DF215AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A35FC3C-69BC-4BDB-A4B2-6BFD0DF215AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A35FC3C-69BC-4BDB-A4B2-6BFD0DF215AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A35FC3C-69BC-4BDB-A4B2-6BFD0DF215AD}.Release|Any CPU.Build.0 = Release|Any CPU - {7524BE44-2B46-454F-80B5-BF131927D948}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7524BE44-2B46-454F-80B5-BF131927D948}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7524BE44-2B46-454F-80B5-BF131927D948}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7524BE44-2B46-454F-80B5-BF131927D948}.Release|Any CPU.Build.0 = Release|Any CPU - {7675B578-9759-4860-B9DC-31FECA809A42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7675B578-9759-4860-B9DC-31FECA809A42}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7675B578-9759-4860-B9DC-31FECA809A42}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7675B578-9759-4860-B9DC-31FECA809A42}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {7524BE44-2B46-454F-80B5-BF131927D948} = {84D6210F-9A65-427A-965F-57E7B76424AB} - {7675B578-9759-4860-B9DC-31FECA809A42} = {84D6210F-9A65-427A-965F-57E7B76424AB} - EndGlobalSection -EndGlobal diff --git a/NRedisStack.slnx b/NRedisStack.slnx new file mode 100644 index 00000000..097f0452 --- /dev/null +++ b/NRedisStack.slnx @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/NRedisStack.sln.DotSettings b/NRedisStack.slnx.DotSettings similarity index 100% rename from NRedisStack.sln.DotSettings rename to NRedisStack.slnx.DotSettings