Skip to content

Commit

Permalink
Adding .NET 6 preview builds support
Browse files Browse the repository at this point in the history
Temporarily adding .NET 6 download to github actions
  • Loading branch information
artiomchi committed Jul 11, 2021
1 parent d1efab1 commit c96b559
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 21 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/build-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,25 @@ jobs:
ACCEPT_EULA: Y
SA_PASSWORD: Password12!
steps:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0'
include-prerelease: True
- uses: actions/checkout@v2
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore /p:CORE_ONLY=true
run: dotnet build --no-restore /p:CORE_ONLY=true /p:V6_ONLY=true
- name: Test
run: dotnet test --no-build /p:CORE_ONLY=true
run: dotnet test --no-build /p:V6_ONLY=true

build-windows:
runs-on: windows-latest
steps:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0'
include-prerelease: True
- uses: actions/checkout@v2
- name: Enable Postgres
run: sc config postgresql-x64-13 start= demand
Expand All @@ -50,6 +58,6 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore /p:POSTGRES_ONLY=true
run: dotnet build --no-restore /p:POSTGRES_ONLY=true /p:V6_ONLY=true
- name: Test
run: dotnet test --no-build
run: dotnet test --no-build /p:V6_ONLY=true
8 changes: 6 additions & 2 deletions .github/workflows/build-quick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0'
include-prerelease: True
- uses: actions/checkout@v2
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore /p:CORE_ONLY=true
run: dotnet build --no-restore /p:CORE_ONLY=true /p:V6_ONLY=true
- name: Test
run: dotnet test ./test/FlexLabs.EntityFrameworkCore.Upsert.Tests --no-build /p:CORE_ONLY=true
run: dotnet test ./test/FlexLabs.EntityFrameworkCore.Upsert.Tests --no-build /p:V6_ONLY=true
4 changes: 2 additions & 2 deletions FlexLabs.Upsert.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29123.89
# Visual Studio Version 17
VisualStudioVersion = 17.0.31410.414
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".solution", ".solution", "{8F601D76-FA75-4B32-AACB-559A63305223}"
ProjectSection(SolutionItems) = preProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<NeutralLanguage>en</NeutralLanguage>
<Nullable>enable</Nullable>
Expand All @@ -20,8 +20,11 @@ Also supports injecting sql command generators to add support for other provider
<RepositoryUrl>https://github.com/artiomchi/FlexLabs.Upsert</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>Entity Framework Core entity-framework-core EF EntityFramework EntityFrameworkCore EFCore Upsert</PackageTags>
<VersionPrefix>5.0.0</VersionPrefix>
<VersionPrefix>6.0.0</VersionPrefix>
<PackageReleaseNotes>
v6.0.0
+ Adding support for EF Core 6

v5.0.0
! Fixing the library versioning. From now one, one version of the library depends on one version of EF Core, for all supported target frameworks

Expand All @@ -48,13 +51,20 @@ v4.0.0
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0-preview.5.21301.9" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'=='Release'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<!-- Workaround for this bug (replace the analyzer name with the one you need to exclude (filename only, no extension) -->
<Target Name="RemoveLoggingAnalyzer" BeforeTargets="CoreCompile" Condition="'$(TargetFramework)'!='net6.0'">
<ItemGroup>
<Analyzer Remove="@(Analyzer)" Condition="%(FileName) == 'Microsoft.Extensions.Logging.Generators'" />
</ItemGroup>
</Target>

<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<NoWarn>EF1001</NoWarn>
<IsPackable>false</IsPackable>
Expand All @@ -11,16 +11,20 @@
<DefineConstants>$(DefineConstants);NOMSSQL;NOMYSQL;POSTGRES_ONLY</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(V6_ONLY)'!=''">
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0-preview.5.21301.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-preview.5.21301.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0-preview.5.21301.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.7" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0-preview5" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.14" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0-preview.5" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -33,6 +37,14 @@
<ProjectReference Include="..\..\src\FlexLabs.EntityFrameworkCore.Upsert\FlexLabs.EntityFrameworkCore.Upsert.csproj" />
</ItemGroup>

<!-- Workaround for this bug (replace the analyzer name with the one you need to exclude (filename only, no extension) -->
<Target Name="RemoveLoggingAnalyzer" BeforeTargets="CoreCompile" Condition="'$(TargetFramework)'!='net6.0'">
<ItemGroup>
<Analyzer Remove="@(Analyzer)" Condition="%(FileName) == 'Microsoft.Extensions.Logging.Generators'" />
<Analyzer Remove="@(Analyzer)" Condition="%(FileName) == 'System.Text.Json.SourceGeneration'" />
</ItemGroup>
</Target>

<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<NoWarn>EF1001</NoWarn>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(V6_ONLY)'!=''">
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-preview.5.21301.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.14" />
Expand All @@ -25,6 +29,14 @@
<ProjectReference Include="..\..\src\FlexLabs.EntityFrameworkCore.Upsert\FlexLabs.EntityFrameworkCore.Upsert.csproj" />
</ItemGroup>

<!-- Workaround for this bug (replace the analyzer name with the one you need to exclude (filename only, no extension) -->
<Target Name="RemoveLoggingAnalyzer" BeforeTargets="CoreCompile" Condition="'$(TargetFramework)'!='net6.0'">
<ItemGroup>
<Analyzer Remove="@(Analyzer)" Condition="%(FileName) == 'Microsoft.Extensions.Logging.Generators'" />
<Analyzer Remove="@(Analyzer)" Condition="%(FileName) == 'System.Text.Json.SourceGeneration'" />
</ItemGroup>
</Target>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ private static void AddEntity<TEntity>(Model model)
var entityType = model.AddEntityType(clrType, ConfigurationSource.Convention);
foreach (var property in clrType.GetProperties())
{
entityType.AddProperty(property.Name);
entityType.AddProperty(property.Name, ConfigurationSource.Explicit);
}
entityType.AddKey(entityType.GetProperty("ID") as Property, ConfigurationSource.Convention);
var idProperty = entityType.FindProperty("ID");
if (idProperty == null)
throw new InvalidOperationException("ID property missing on entity " + typeof(TEntity).Name);
entityType.AddKey(idProperty, ConfigurationSource.Convention);
}

protected abstract string NoUpdate_Sql { get; }
Expand Down

0 comments on commit c96b559

Please sign in to comment.