Skip to content

Commit

Permalink
Remove tests for .NET SDK 3.1 and 5, add tests for .NET 9 (#444)
Browse files Browse the repository at this point in the history
* Remove netcoreapp3.1 and net5, add net9

* Add target framework to dotnet build

* Add explicit use net9 task

* Swap targetFramework and dotnetVersion in matrix
  • Loading branch information
zijchen authored May 16, 2024
1 parent a888164 commit 31d4f4a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,26 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
dotnetVersion: [3.1.x, 5.x, 6.x, 7.x, 8.x]
targetFramework: [net6.0, net7.0, net8.0, net9.0]
include:
- dotnetVersion: 3.1.x
targetFramework: netcoreapp3.1
- dotnetVersion: 5.x
targetFramework: net5.0
- dotnetVersion: 6.x
targetFramework: net6.0
- dotnetVersion: 7.x
targetFramework: net7.0
- dotnetVersion: 8.x
targetFramework: net8.0
- targetFramework: net6.0
dotnetVersion: 6.x
- targetFramework: net7.0
dotnetVersion: 7.x
- targetFramework: net8.0
dotnetVersion: 8.x
- targetFramework: net9.0
dotnetVersion: 9.x
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4 # Latest version is always required
with:
dotnet-version: 9.x
dotnet-quality: preview
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnetVersion }}
dotnet-quality: preview
- run: dotnet build DacFx.sln
- run: dotnet pack DacFx.sln --no-build
- run: dotnet test DacFx.sln --no-build -f ${{ matrix.targetFramework }}
7 changes: 3 additions & 4 deletions test/Microsoft.Build.Sql.Tests/BuildTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,16 @@ public void VerifyBuildWithTransitiveProjectReferences()
[TestCase("net481")]
[TestCase("netstandard2.1")]
[TestCase("netcoreapp3.1")]
#if NET5_0_OR_GREATER
[TestCase("net5.0")]
#endif
#if NET6_0_OR_GREATER
[TestCase("net6.0")]
#endif
#if NET7_0_OR_GREATER
[TestCase("net7.0")]
#endif
#if NET8_0_OR_GREATER
[TestCase("net8.0")]
#endif
#if NET9_0_OR_GREATER
[TestCase("net9.0")]
#endif
// https://github.com/microsoft/DacFx/issues/330
public void VerifyBuildWithDifferentTargetFrameworks(string targetFramework)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<!-- Multi-targeting to test SDK on different .NET versions, requires all of the following SDKs to be installed. -->
<!-- To build and test only one version, add -f to dotnet command. -->
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<Nullable>enable</Nullable>
<!-- Disable EOL target framework check since we're explicitly testing against older .NET versions. -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
Expand Down

0 comments on commit 31d4f4a

Please sign in to comment.