Skip to content

Commit e82c5be

Browse files
committed
Update test project frameworks and github actions
1 parent 3e7f1e6 commit e82c5be

File tree

4 files changed

+55
-50
lines changed

4 files changed

+55
-50
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ on:
99
jobs:
1010
build-library:
1111
runs-on: ubuntu-latest
12+
1213
steps:
13-
- uses: actions/checkout@v2
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
1416

15-
- name: Setup .NET
16-
uses: actions/setup-dotnet@v1
17+
- name: Setup .NET Core
18+
uses: actions/setup-dotnet@v3
1719
with:
18-
dotnet-version: 6.0.x
20+
dotnet-version: |
21+
3.1.x
22+
5.0.x
23+
6.0.x
24+
7.0.x
25+
26+
- name: Display .NET version
27+
run: dotnet --version
1928

2029
- name: Restore dependencies
2130
run: dotnet restore
@@ -24,10 +33,13 @@ jobs:
2433
run: dotnet build EntityFrameworkCore.DataEncryption.sln --configuration Release -f net6.0 --no-restore
2534

2635
- name: Run unit tests
27-
run: dotnet test EntityFrameworkCore.DataEncryption.sln --configuration Release /p:CollectCoverage=true /p:Exclude="[xunit*]*" /p:CoverletOutputFormat=opencover /p:CoverletOutput="../TestResults/TestResults.xml" /maxcpucount:1 -f net6.0 --no-build --verbosity normal
36+
run: dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings ./test/EntityFrameworkCore.DataEncryption.Test/runsettings.xml
37+
38+
- name: Copy coverage results
39+
run: cp ./test/EntityFrameworkCore.DataEncryption.Test/TestResults/**/*.xml ./test/EntityFrameworkCore.DataEncryption.Test/TestResults/
2840

2941
- name: Upload code coverage
3042
uses: codecov/codecov-action@v3
3143
with:
32-
files: ./test/TestResults/TestResults.xml
44+
files: ./test/EntityFrameworkCore.DataEncryption.Test/TestResults/coverage.opencover.xml
3345
fail_ci_if_error: true

src/EntityFrameworkCore.DataEncryption/EntityFrameworkCore.DataEncryption.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net7.0;net6.0;net5.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
55
<LangVersion>10.0</LangVersion>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<AssemblyName>EntityFrameworkCore.DataEncryption</AssemblyName>
@@ -37,9 +37,6 @@
3737
<ItemGroup Condition="('$(TargetFramework)' == 'netstandard2.1')">
3838
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[5,)" />
3939
</ItemGroup>
40-
<ItemGroup Condition="('$(TargetFramework)' == 'net5.0')">
41-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[5,)" />
42-
</ItemGroup>
4340
<ItemGroup Condition="('$(TargetFramework)' == 'net6.0')">
4441
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[6,)" />
4542
</ItemGroup>
Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,31 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<LangVersion>10</LangVersion>
6-
<IsPackable>false</IsPackable>
7-
<AssemblyName>Microsoft.EntityFrameworkCore.Encryption.Test</AssemblyName>
8-
<RootNamespace>Microsoft.EntityFrameworkCore.Encryption.Test</RootNamespace>
9-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<LangVersion>10</LangVersion>
6+
<IsPackable>false</IsPackable>
7+
<AssemblyName>Microsoft.EntityFrameworkCore.Encryption.Test</AssemblyName>
8+
<RootNamespace>Microsoft.EntityFrameworkCore.Encryption.Test</RootNamespace>
9+
</PropertyGroup>
1010

11-
<ItemGroup>
12-
<PackageReference Include="Bogus" Version="34.0.2" />
13-
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
14-
<PrivateAssets>all</PrivateAssets>
15-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
16-
</PackageReference>
17-
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
19-
<PackageReference Include="xunit" Version="2.4.2" />
20-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
21-
<PrivateAssets>all</PrivateAssets>
22-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
23-
</PackageReference>
24-
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
25-
</ItemGroup>
26-
27-
<ItemGroup>
28-
<ProjectReference Include="..\..\src\EntityFrameworkCore.DataEncryption\EntityFrameworkCore.DataEncryption.csproj" />
29-
</ItemGroup>
30-
31-
<ItemGroup Condition="('$(TargetFramework)' == 'netcoreapp3.1')">
32-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[3.1,6)" />
33-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[3.1,6)" />
34-
</ItemGroup>
35-
<ItemGroup Condition="('$(TargetFramework)' == 'net5.0')">
36-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[5,)" />
37-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[5,)" />
38-
</ItemGroup>
39-
<ItemGroup Condition="('$(TargetFramework)' == 'net6.0')">
40-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[6,)" />
41-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="[6,)" />
42-
</ItemGroup>
4311
<ItemGroup>
44-
<Folder Include="Migration\" />
12+
<ProjectReference Include="..\..\src\EntityFrameworkCore.DataEncryption\EntityFrameworkCore.DataEncryption.csproj" />
4513
</ItemGroup>
4614

15+
<ItemGroup>
16+
<PackageReference Include="Bogus" Version="34.0.2" />
17+
<PackageReference Include="coverlet.collector" Version="3.2.0">
18+
<PrivateAssets>all</PrivateAssets>
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
</PackageReference>
21+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.11" />
22+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.11" />
23+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
24+
<PackageReference Include="xunit" Version="2.4.2" />
25+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
26+
<PrivateAssets>all</PrivateAssets>
27+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
28+
</PackageReference>
29+
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
30+
</ItemGroup>
4731
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<RunSettings>
3+
<DataCollectionRunSettings>
4+
<DataCollectors>
5+
<DataCollector friendlyName="XPlat code coverage">
6+
<Configuration>
7+
<Format>opencover</Format>
8+
</Configuration>
9+
</DataCollector>
10+
</DataCollectors>
11+
</DataCollectionRunSettings>
12+
</RunSettings>

0 commit comments

Comments
 (0)