Skip to content

Commit

Permalink
feat: Support .NET 7.0 target
Browse files Browse the repository at this point in the history
Signed-off-by: Sagilio <[email protected]>
  • Loading branch information
sagilio committed Feb 23, 2022
1 parent e098a5b commit 6c286b6
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 11 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:
with:
dotnet-version: 6.0.x

- name: Setup .NET 7.0.x SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
include-prerelease: true

- name: Check .NET info
run: dotnet --info

Expand All @@ -47,13 +53,13 @@ jobs:
run: dotnet build -c Release --no-restore

- name: Test solution
run: dotnet test -c Release --no-build --no-restore --verbosity normal -r test-results --collect:"XPlat Code Coverage" `
run: dotnet test -c Release --no-build --no-restore --results-directory test-results --verbosity normal --collect:"XPlat Code Coverage" `
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=json,cobertura,lcov,teamcity,opencover

- name: Upload coverage
if: github.repository_owner == 'casbin' && github.event_name == 'push'
run: |
dotnet tool install coveralls.net --version 2.0.0-beta0002 --tool-path tools;
dotnet tool install coveralls.net --version 3.0.0 --tool-path tools;
$CommitAuthor = git show -s --pretty=format:"%cn";
echo "Coomit author is: $CommitAuthor";
$CommitAuthorEmail = git show -s --pretty=format:"%ce";
Expand Down Expand Up @@ -102,6 +108,12 @@ jobs:
with:
dotnet-version: 6.0.x

- name: Setup .NET 7.0.x SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
include-prerelease: true

- name: Check .NET info
run: dotnet --info

Expand All @@ -117,7 +129,7 @@ jobs:
- name: Run benchmark
run: |
cd Casbin.Benchmark
dotnet run -c Release --filter ** -f net5
dotnet run -c Release --filter ** -f net6.0
- name: Upload benchmark results to artefacts
uses: actions/[email protected]
Expand Down Expand Up @@ -172,6 +184,12 @@ jobs:
with:
dotnet-version: 6.0.x

- name: Setup .NET 7.0.x SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
include-prerelease: true

- name: Check .NET info
run: dotnet --info

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
with:
dotnet-version: 6.0.x

- name: Setup .NET 7.0.x SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
include-prerelease: true

- name: Check .NET info
run: dotnet --info

Expand Down Expand Up @@ -123,6 +129,12 @@ jobs:
with:
dotnet-version: 6.0.x

- name: Setup .NET 7.0.x SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
include-prerelease: true

- name: Check .NET info
run: dotnet --info

Expand Down
2 changes: 1 addition & 1 deletion Casbin.Benchmark/Casbin.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<ServerGarbageCollection>true</ServerGarbageCollection>
<TargetFrameworks>net6;net5;netcoreapp3.1;net48</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net5.0;netcoreapp3.1;net48</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions Casbin.UnitTest/Casbin.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6;net5;netcoreapp3.1;net461;net452</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net5.0;netcoreapp3.1;net461;net452</TargetFrameworks>
<DebugType>full</DebugType>
<IsPackable>false</IsPackable>
<LangVersion>10.0</LangVersion>
Expand All @@ -13,13 +13,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
12 changes: 8 additions & 4 deletions Casbin/Casbin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6;net5;netcoreapp3.1;netstandard2.1;netstandard2.0;net461;net452;</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.1;netstandard2.0;net461;net452;</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591;CS0618</NoWarn>
<LangVersion>10.0</LangVersion>
</PropertyGroup>
Expand Down Expand Up @@ -47,11 +47,15 @@
<PackageReference Include="Microsoft.SourceLink.Github" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0"/>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0-preview.1.22076.8"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5'">
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Versiodn="6.0.0"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0"/>
</ItemGroup>

Expand Down

0 comments on commit 6c286b6

Please sign in to comment.