Skip to content

Commit e604b74

Browse files
msfreedmitch-wilqo
andauthored
feat: upgrade to casbin v2 (#10)
* feat: upgrade to casbin v2 * fix ci, update lang version, cleanup * cleanup ci * fix syntax --------- Co-authored-by: Mitch Freed <[email protected]>
1 parent 457cdc6 commit e604b74

File tree

15 files changed

+544
-625
lines changed

15 files changed

+544
-625
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ jobs:
3434
run: “C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe”
3535

3636
- name: Setup .NET SDK
37-
uses: actions/setup-dotnet@v2
37+
uses: actions/setup-dotnet@v3
3838
with:
3939
dotnet-version: |
40-
3.1.x
41-
5.0.x
4240
6.0.x
4341
7.0.x
42+
8.0.x
4443
include-prerelease: true
4544

4645
- name: Check .NET info
@@ -61,11 +60,11 @@ jobs:
6160
run: |
6261
dotnet tool install coveralls.net --version 3.0.0 --tool-path tools;
6362
$CommitAuthor = git show -s --pretty=format:"%cn";
64-
echo "Coomit author is: $CommitAuthor";
63+
echo "Commit author is: $CommitAuthor";
6564
$CommitAuthorEmail = git show -s --pretty=format:"%ce";
66-
echo "Coomit author email is: $CommitAuthorEmail";
65+
echo "Commit author email is: $CommitAuthorEmail";
6766
$CommitMessage = git show -s --pretty=format:"%s";
68-
echo "Coomit message is: $CommitMessage";
67+
echo "Commit message is: $CommitMessage";
6968
cp test-results/**/*.opencover.xml test-results
7069
tools/csmacnz.Coveralls --opencover -i test-results/coverage.opencover.xml --repoToken $env:COVERALLS_REPO_TOKEN `
7170
--commitId $env:SHA --commitBranch $env:REF --commitAuthor "$CommitAuthor" `
@@ -74,7 +73,7 @@ jobs:
7473
7574
if($LastExitCode -ne 0)
7675
{
77-
Write-Warning -Message "Can not upload coverage, laat exit code is ${LastExitCode}."
76+
Write-Warning -Message "Can not upload coverage, last exit code is ${LastExitCode}."
7877
$LastExitCode = 0;
7978
}
8079
@@ -118,13 +117,12 @@ jobs:
118117
run: git tag -l -n
119118

120119
- name: Setup .NET SDK
121-
uses: actions/setup-dotnet@v2
120+
uses: actions/setup-dotnet@v3
122121
with:
123122
dotnet-version: |
124-
3.1.x
125-
5.0.x
126123
6.0.x
127124
7.0.x
125+
8.0.x
128126
include-prerelease: true
129127

130128
- name: Check .NET info

.github/workflows/release.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ jobs:
3535
run: “C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe”
3636

3737
- name: Setup .NET SDK
38-
uses: actions/setup-dotnet@v2
38+
uses: actions/setup-dotnet@v3
3939
with:
4040
dotnet-version: |
41-
3.1.x
42-
5.0.x
4341
6.0.x
4442
7.0.x
43+
8.0.x
4544
include-prerelease: true
4645

4746
- name: Check .NET info
@@ -61,11 +60,11 @@ jobs:
6160
run: |
6261
dotnet tool install coveralls.net --version 3.0.0 --tool-path tools;
6362
$CommitAuthor = git show -s --pretty=format:"%cn";
64-
echo "Coomit author is: $CommitAuthor";
63+
echo "Commit author is: $CommitAuthor";
6564
$CommitAuthorEmail = git show -s --pretty=format:"%ce";
66-
echo "Coomit author email is: $CommitAuthorEmail";
65+
echo "Commit author email is: $CommitAuthorEmail";
6766
$CommitMessage = git show -s --pretty=format:"%s";
68-
echo "Coomit message is: $CommitMessage";
67+
echo "Commit message is: $CommitMessage";
6968
cp test-results/**/*.opencover.xml test-results
7069
tools/csmacnz.Coveralls --opencover -i test-results/coverage.opencover.xml --repoToken $env:COVERALLS_REPO_TOKEN `
7170
--commitId $env:SHA --commitBranch $env:REF --commitAuthor "$CommitAuthor" `
@@ -74,7 +73,7 @@ jobs:
7473
7574
if($LastExitCode -ne 0)
7675
{
77-
Write-Warning -Message "Can not upload coverage, laat exit code is ${LastExitCode}."
76+
Write-Warning -Message "Can not upload coverage, last exit code is ${LastExitCode}."
7877
$LastExitCode = 0;
7978
}
8079
@@ -117,13 +116,12 @@ jobs:
117116
run: git tag -l -n
118117

119118
- name: Setup .NET SDK
120-
uses: actions/setup-dotnet@v2
119+
uses: actions/setup-dotnet@v3
121120
with:
122121
dotnet-version: |
123-
3.1.x
124-
5.0.x
125122
6.0.x
126123
7.0.x
124+
8.0.x
127125
include-prerelease: true
128126

129127
- name: Check .NET info

Casbin.Watcher.Redis.UnitTest/Casbin.Watcher.Redis.UnitTest.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net7.0;net6.0;</TargetFrameworks>
5+
<LangVersion>11</LangVersion>
6+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
57
<IsPackable>false</IsPackable>
68
</PropertyGroup>
79

810
<ItemGroup>
9-
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
11+
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
1012
<PrivateAssets>all</PrivateAssets>
1113
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1214
</PackageReference>
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
1416
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
15-
<PackageReference Include="xunit" Version="2.4.1" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
17+
<PackageReference Include="xunit" Version="2.6.6" />
18+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
1719
<PrivateAssets>all</PrivateAssets>
1820
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1921
</PackageReference>
22+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
2023
</ItemGroup>
2124

2225
<ItemGroup>
2326
<ProjectReference Include="..\Casbin.Watcher.Redis\Casbin.Watcher.Redis.csproj" />
2427
</ItemGroup>
2528

2629
<ItemGroup>
27-
<None Update="examples\rbac_policy.csv">
28-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
29-
</None>
30-
<None Update="examples\rbac_model.conf">
31-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
30+
<None Update="examples\**">
31+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3232
</None>
3333
</ItemGroup>
3434

0 commit comments

Comments
 (0)