Skip to content

Commit

Permalink
feat: upgrade to casbin v2 (#10)
Browse files Browse the repository at this point in the history
* feat: upgrade to casbin v2

* fix ci, update lang version, cleanup

* cleanup ci

* fix syntax

---------

Co-authored-by: Mitch Freed <[email protected]>
  • Loading branch information
msfreed and mitch-wilqo authored Jan 18, 2024
1 parent 457cdc6 commit e604b74
Show file tree
Hide file tree
Showing 15 changed files with 544 additions and 625 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ jobs:
run: “C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe”

- name: Setup .NET SDK
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
include-prerelease: true

- name: Check .NET info
Expand All @@ -61,11 +60,11 @@ jobs:
run: |
dotnet tool install coveralls.net --version 3.0.0 --tool-path tools;
$CommitAuthor = git show -s --pretty=format:"%cn";
echo "Coomit author is: $CommitAuthor";
echo "Commit author is: $CommitAuthor";
$CommitAuthorEmail = git show -s --pretty=format:"%ce";
echo "Coomit author email is: $CommitAuthorEmail";
echo "Commit author email is: $CommitAuthorEmail";
$CommitMessage = git show -s --pretty=format:"%s";
echo "Coomit message is: $CommitMessage";
echo "Commit message is: $CommitMessage";
cp test-results/**/*.opencover.xml test-results
tools/csmacnz.Coveralls --opencover -i test-results/coverage.opencover.xml --repoToken $env:COVERALLS_REPO_TOKEN `
--commitId $env:SHA --commitBranch $env:REF --commitAuthor "$CommitAuthor" `
Expand All @@ -74,7 +73,7 @@ jobs:
if($LastExitCode -ne 0)
{
Write-Warning -Message "Can not upload coverage, laat exit code is ${LastExitCode}."
Write-Warning -Message "Can not upload coverage, last exit code is ${LastExitCode}."
$LastExitCode = 0;
}
Expand Down Expand Up @@ -118,13 +117,12 @@ jobs:
run: git tag -l -n

- name: Setup .NET SDK
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
include-prerelease: true

- name: Check .NET info
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ jobs:
run: “C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe”

- name: Setup .NET SDK
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
include-prerelease: true

- name: Check .NET info
Expand All @@ -61,11 +60,11 @@ jobs:
run: |
dotnet tool install coveralls.net --version 3.0.0 --tool-path tools;
$CommitAuthor = git show -s --pretty=format:"%cn";
echo "Coomit author is: $CommitAuthor";
echo "Commit author is: $CommitAuthor";
$CommitAuthorEmail = git show -s --pretty=format:"%ce";
echo "Coomit author email is: $CommitAuthorEmail";
echo "Commit author email is: $CommitAuthorEmail";
$CommitMessage = git show -s --pretty=format:"%s";
echo "Coomit message is: $CommitMessage";
echo "Commit message is: $CommitMessage";
cp test-results/**/*.opencover.xml test-results
tools/csmacnz.Coveralls --opencover -i test-results/coverage.opencover.xml --repoToken $env:COVERALLS_REPO_TOKEN `
--commitId $env:SHA --commitBranch $env:REF --commitAuthor "$CommitAuthor" `
Expand All @@ -74,7 +73,7 @@ jobs:
if($LastExitCode -ne 0)
{
Write-Warning -Message "Can not upload coverage, laat exit code is ${LastExitCode}."
Write-Warning -Message "Can not upload coverage, last exit code is ${LastExitCode}."
$LastExitCode = 0;
}
Expand Down Expand Up @@ -117,13 +116,12 @@ jobs:
run: git tag -l -n

- name: Setup .NET SDK
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
include-prerelease: true

- name: Check .NET info
Expand Down
20 changes: 10 additions & 10 deletions Casbin.Watcher.Redis.UnitTest/Casbin.Watcher.Redis.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;</TargetFrameworks>
<LangVersion>11</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Casbin.Watcher.Redis\Casbin.Watcher.Redis.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="examples\rbac_policy.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="examples\rbac_model.conf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Update="examples\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

Expand Down
Loading

0 comments on commit e604b74

Please sign in to comment.