Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/microsoft/DacFx into zijche…
Browse files Browse the repository at this point in the history
…n/sqltasks
  • Loading branch information
zijchen committed Feb 12, 2024
2 parents a2aeced + e300631 commit f0833d1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: pr-validation

on: pull_request

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
dotnetVersion: [3.1.x, 5.x, 6.x, 7.x, 8.x]
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: ${{ matrix.dotnetVersion }}
- run: dotnet build DacFx.sln
- run: dotnet pack DacFx.sln --no-build
- run: dotnet test DacFx.sln --no-build -f ${{ matrix.targetFramework }}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<TemplateIntermediateOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)\$(MSBuildThisFileName)\sqlproject</TemplateIntermediateOutputPath>
<!-- NU5128 warns about dependencies, template package has no dependencies. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<NoDefaultExcludes>true</NoDefaultExcludes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -40,6 +41,7 @@
MatchExpression="###ASSEMBLY_VERSION###"
ReplacementText="$(PackageVersion)" />
<ItemGroup>
<Content Remove="$(TemplateIntermediateOutputPath)\**" />
<Content Include="$(TemplateIntermediateOutputPath)\**" PackagePath="content/" Pack="true" />
</ItemGroup>
</Target>
Expand Down
7 changes: 4 additions & 3 deletions test/Microsoft.Build.Sql.Tests/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Microsoft.Build.Sql.Tests
public static class TestUtils
{
private const string DotnetToolPathEnvironmentVariable = "DOTNET_TOOL_PATH";
private const string DotnetRootEnvironmentVariable = "DOTNET_ROOT";

/// <summary>
/// Returns the full path to the dotnet executable based on the current operating system.
Expand All @@ -18,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);
string? dotnetPath = Environment.GetEnvironmentVariable(DotnetToolPathEnvironmentVariable) ?? Environment.GetEnvironmentVariable(DotnetRootEnvironmentVariable);
if (string.IsNullOrEmpty(dotnetPath))
{
// Determine OS specific dotnet installation path
Expand All @@ -28,7 +29,7 @@ public static string GetDotnetPath()
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
dotnetPath = "/usr/bin/dotnet";
dotnetPath = "/usr/share/dotnet";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Expand Down Expand Up @@ -73,4 +74,4 @@ public static void CopyDirectoryRecursive(string sourceDirectoryPath, string tar
}
}
}
}
}

0 comments on commit f0833d1

Please sign in to comment.