Skip to content

Commit

Permalink
Change dotnet variable and fail fast
Browse files Browse the repository at this point in the history
  • Loading branch information
zijchen committed Feb 9, 2024
1 parent ecbb160 commit e1d14b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,25 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
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'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '3.1.x'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '5.x'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.x'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.x'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- run: dotnet build DacFx.sln
- run: dotnet pack DacFx.sln
- run: dotnet test DacFx.sln -f netcoreapp3.1
- run: dotnet test DacFx.sln -f net5.0
- run: dotnet test DacFx.sln -f net6.0
- run: dotnet test DacFx.sln -f net7.0
- run: dotnet test DacFx.sln -f net8.0
dotnet-version: ${{ matrix.dotnetVersion }}
- run: dotnet build DacFx.sln -f ${{ matrix.targetFramework }}
- run: dotnet pack DacFx.sln -f ${{ matrix.targetFramework }}
- run: dotnet test DacFx.sln -f ${{ matrix.targetFramework }}
4 changes: 2 additions & 2 deletions test/Microsoft.Build.Sql.Tests/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.Build.Sql.Tests
public static class TestUtils
{
private const string DotnetToolPathEnvironmentVariable = "DOTNET_TOOL_PATH";
private const string DotnetInstallDirEnvironmentVariable = "DOTNET_INSTALL_DIR";
private const string DotnetRootEnvironmentVariable = "DOTNET_ROOT";

/// <summary>
/// Returns the full path to the dotnet executable based on the current operating system.
Expand All @@ -19,7 +19,7 @@ public static class TestUtils
public static string GetDotnetPath()
{
string dotnetExecutable = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet";
string? dotnetPath = Environment.GetEnvironmentVariable(DotnetToolPathEnvironmentVariable) ?? Environment.GetEnvironmentVariable(DotnetInstallDirEnvironmentVariable);
string? dotnetPath = Environment.GetEnvironmentVariable(DotnetToolPathEnvironmentVariable) ?? Environment.GetEnvironmentVariable(DotnetRootEnvironmentVariable);
if (string.IsNullOrEmpty(dotnetPath))
{
// Determine OS specific dotnet installation path
Expand Down

0 comments on commit e1d14b2

Please sign in to comment.