Skip to content

Commit

Permalink
Merge pull request #1 from snovak7/main
Browse files Browse the repository at this point in the history
Initial version
  • Loading branch information
snovak7 authored Oct 1, 2023
2 parents 0ceb862 + c13e74c commit 316d3bd
Show file tree
Hide file tree
Showing 103 changed files with 4,580 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[*]
charset = utf-8
insert_final_newline = true
indent_size = tab
indent_style = space
tab_width = 4

[*.cs]
charset = utf-8-bom

[*.{yml,yaml}]
tab_width = 2
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: dotnet build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore .NET Packages
run: dotnet restore
- name: Build .NET Solution
run: dotnet build --configuration Release --no-restore
- name: Test .NET Solution
run: dotnet test --configuration Release --no-build --filter=Category=UnitTest --logger "trx;LogFileName=test-results.trx"
- uses: actions/upload-artifact@v2
if: success() || failure()
with:
name: test-results
path: "**/test-results.trx"
- name: Pack .NET Solution
run: dotnet pack --configuration Release --no-build --output pack/
- name: Publish .NET Solution to GitHub Packages
continue-on-error: true
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: Publish .NET Solution to NuGet.org
env:
apikey: ${{ secrets.NUGET_ORG_KEY }}
if: ${{ env.apikey != '' }}
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget
continue-on-error: true
108 changes: 108 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: SonarCloud
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: windows-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v3
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Build and analyze [main]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: ${{ env.SONAR_TOKEN != null && github.event.pull_request.number == null }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin `
/k:"escendit_cassandra-orleans-extensions" `
/o:"escendit" `
/v:${{ env.GitVersion_FullSemVer }} `
/d:sonar.login="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.host.url="https://sonarcloud.io" `
/d:sonar.cs.vstest.reportsPaths=**/TestResults/*.trx `
/d:sonar.cs.opencover.reportsPaths=**/TestResults/*/coverage.opencover.xml `
/d:sonar.coverage.exclusions="**Test*.cs"
dotnet build --configuration Release
dotnet test `
--configuration Release `
--no-build `
--filter=Category=UnitTest `
--collect "XPlat Code Coverage" `
--results-directory TestResults/ `
--logger "trx;LogFileName=test-results.trx" `
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
- name: Build and analyze [pull request]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: ${{ env.SONAR_TOKEN != null && github.event.pull_request.number != null }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin `
/k:"escendit_cassandra-orleans-extensions" `
/o:"escendit" `
/v:${{ env.GitVersion_FullSemVer }} `
/d:sonar.pullrequest.key="${{ github.event.pull_request.number }}" `
/d:sonar.login="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.host.url="https://sonarcloud.io" `
/d:sonar.cs.vstest.reportsPaths=**/TestResults/*.trx `
/d:sonar.cs.opencover.reportsPaths=**/TestResults/*/coverage.opencover.xml `
/d:sonar.coverage.exclusions="**Test*.cs"
dotnet build --configuration Release
dotnet test `
--configuration Release `
--no-build `
--filter=Category=UnitTest `
--collect "XPlat Code Coverage" `
--results-directory TestResults/ `
--logger "trx;LogFileName=test-results.trx" `
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
16 changes: 16 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: dotnet test report
on:
workflow_run:
workflows: ['dotnet build']
types:
- completed
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: test-results
name: dotnet tests
path: '**/test-results.trx'
reporter: dotnet-trx
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,6 @@ node_modules/
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand Down Expand Up @@ -396,3 +392,4 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml
.idea/
3 changes: 3 additions & 0 deletions .globalconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
is_global = true

dotnet_diagnostic.SA1135.severity = none
54 changes: 54 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<PropertyGroup>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/escendit/cassandra-orleans-extensions</RepositoryUrl>
</PropertyGroup>
<PropertyGroup>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<CodeAnalysisRuleSetLocation>$(SolutionDir)</CodeAnalysisRuleSetLocation>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Escendit.Tools.Branding">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Escendit.Tools.CodeAnalysis.NetAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Escendit.Tools.CodeAnalysis.SecurityCodeScanAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Escendit.Tools.CodeAnalysis.StyleCopAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="GitVersion.MsBuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Escendit.Tools.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Not Transitive, needs to be included -->
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
35 changes: 35 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="CassandraCSharpDriver" Version="3.19.3"/>
<PackageVersion Include="coverlet.collector" Version="6.0.0"/>
<PackageVersion Include="Escendit.Extensions.DependencyInjection.Cassandra" Version="0.1.0-rc.90"/>
<PackageVersion Include="Escendit.Extensions.Hosting.Cassandra" Version="0.1.0-rc.90"/>
<PackageVersion Include="Escendit.Tools.Branding" Version="1.0.2"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.NetAnalyzers" Version="0.5.0"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.NSubstituteAnalyzers" Version="0.1.0-rc.18"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.SecurityCodeScanAnalyzers" Version="0.5.0"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.SonarAnalyzers" Version="0.5.0"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.StyleCopAnalyzers" Version="0.5.0"/>
<PackageVersion Include="Escendit.Tools.CodeAnalysis.xUnitAnalyzers" Version="0.1.0-rc.21"/>
<PackageVersion Include="Escendit.Tools.SourceLink.GitHub" Version="0.4.0"/>
<PackageVersion Include="GitVersion.MsBuild" Version="5.12.0"/>
<PackageVersion Include="JunitXml.TestLogger" Version="3.0.134"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2"/>
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="7.0.1" Condition="'$(TargetFramework)' == 'net7.0'"/>
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" Condition="'$(TargetFramework)' == 'net7.0'"/>
<PackageVersion Include="Microsoft.Extensions.Options" Version="7.0.1" Condition="'$(TargetFramework)' == 'net7.0'"/>
<PackageVersion Include="Microsoft.Orleans.Core" Version="7.2.1"/>
<PackageVersion Include="Microsoft.Orleans.Reminders" Version="7.2.1"/>
<PackageVersion Include="Microsoft.Orleans.Runtime" Version="7.2.1"/>
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="7.2.1"/>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1"/>
<PackageVersion Include="NSubstitute" Version="5.1.0"/>
<PackageVersion Include="xunit" Version="2.5.1"/>
<PackageVersion Include="xunit.categories" Version="2.0.8"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.1"/>
</ItemGroup>
</Project>
85 changes: 85 additions & 0 deletions Escendit.Orleans.Extensions.Cassandra.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BE03B4BC-8D74-42CA-81AC-014417FCFEB9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F719A264-551D-450A-9FBF-F3802858FFAE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Clustering", "Clustering", "{5F161A73-5C42-4602-AB22-16EB85DEC048}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCore", "AspNetCore", "{FED9F72C-209F-4539-B7C0-730DE379B1BF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Reminders", "Reminders", "{77E5F3C7-A347-42F4-BF93-51248B035D56}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Persistence", "Persistence", "{2950C6B5-E391-4569-AAB5-D8BEB92FF7B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escendit.Orleans.Clustering.Cassandra", "src\Clustering\Cassandra\Escendit.Orleans.Clustering.Cassandra.csproj", "{D1643CDC-E454-441C-86D9-81207E8A0707}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escendit.Orleans.Persistence.Cassandra", "src\Persistence\Cassandra\Escendit.Orleans.Persistence.Cassandra.csproj", "{C7BF8816-1982-4672-9ADB-55B2CC73C63B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escendit.Orleans.Reminders.Cassandra", "src\Reminders\Cassandra\Escendit.Orleans.Reminders.Cassandra.csproj", "{6E3EEC03-C465-4C7F-93FB-E62A2ECC6847}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Persistence", "Persistence", "{9DC8501A-84DE-4272-A660-6615DA7C91B0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escendit.Orleans.Persistence.Cassandra.Tests", "test\Persistence\Cassandra\Escendit.Orleans.Persistence.Cassandra.Tests.csproj", "{7D40168C-40B6-4339-88A0-4F6E408F2EE7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Clustering", "Clustering", "{16F96498-E9B7-4747-898A-86AF7D6B44D5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escendit.Orleans.Clustering.Cassandra.Tests", "test\Clustering\Cassandra\Escendit.Orleans.Clustering.Cassandra.Tests.csproj", "{A9488ABE-E593-46FB-9C63-32A687EEFE38}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Reminders", "Reminders", "{051C13BE-64CE-42A2-A67C-46A7DCA55095}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escendit.Orleans.Reminders.Cassandra.Tests", "test\Reminders\Cassandra\Escendit.Orleans.Reminders.Cassandra.Tests.csproj", "{F14B85E6-725E-4F78-BDAB-0240DB573333}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5F161A73-5C42-4602-AB22-16EB85DEC048} = {BE03B4BC-8D74-42CA-81AC-014417FCFEB9}
{FED9F72C-209F-4539-B7C0-730DE379B1BF} = {BE03B4BC-8D74-42CA-81AC-014417FCFEB9}
{77E5F3C7-A347-42F4-BF93-51248B035D56} = {BE03B4BC-8D74-42CA-81AC-014417FCFEB9}
{2950C6B5-E391-4569-AAB5-D8BEB92FF7B8} = {BE03B4BC-8D74-42CA-81AC-014417FCFEB9}
{D1643CDC-E454-441C-86D9-81207E8A0707} = {5F161A73-5C42-4602-AB22-16EB85DEC048}
{C7BF8816-1982-4672-9ADB-55B2CC73C63B} = {2950C6B5-E391-4569-AAB5-D8BEB92FF7B8}
{6E3EEC03-C465-4C7F-93FB-E62A2ECC6847} = {77E5F3C7-A347-42F4-BF93-51248B035D56}
{9DC8501A-84DE-4272-A660-6615DA7C91B0} = {F719A264-551D-450A-9FBF-F3802858FFAE}
{7D40168C-40B6-4339-88A0-4F6E408F2EE7} = {9DC8501A-84DE-4272-A660-6615DA7C91B0}
{16F96498-E9B7-4747-898A-86AF7D6B44D5} = {F719A264-551D-450A-9FBF-F3802858FFAE}
{A9488ABE-E593-46FB-9C63-32A687EEFE38} = {16F96498-E9B7-4747-898A-86AF7D6B44D5}
{051C13BE-64CE-42A2-A67C-46A7DCA55095} = {F719A264-551D-450A-9FBF-F3802858FFAE}
{F14B85E6-725E-4F78-BDAB-0240DB573333} = {051C13BE-64CE-42A2-A67C-46A7DCA55095}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D1643CDC-E454-441C-86D9-81207E8A0707}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1643CDC-E454-441C-86D9-81207E8A0707}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1643CDC-E454-441C-86D9-81207E8A0707}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1643CDC-E454-441C-86D9-81207E8A0707}.Release|Any CPU.Build.0 = Release|Any CPU
{C7BF8816-1982-4672-9ADB-55B2CC73C63B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7BF8816-1982-4672-9ADB-55B2CC73C63B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7BF8816-1982-4672-9ADB-55B2CC73C63B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7BF8816-1982-4672-9ADB-55B2CC73C63B}.Release|Any CPU.Build.0 = Release|Any CPU
{6E3EEC03-C465-4C7F-93FB-E62A2ECC6847}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E3EEC03-C465-4C7F-93FB-E62A2ECC6847}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E3EEC03-C465-4C7F-93FB-E62A2ECC6847}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E3EEC03-C465-4C7F-93FB-E62A2ECC6847}.Release|Any CPU.Build.0 = Release|Any CPU
{7D40168C-40B6-4339-88A0-4F6E408F2EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D40168C-40B6-4339-88A0-4F6E408F2EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D40168C-40B6-4339-88A0-4F6E408F2EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D40168C-40B6-4339-88A0-4F6E408F2EE7}.Release|Any CPU.Build.0 = Release|Any CPU
{A9488ABE-E593-46FB-9C63-32A687EEFE38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9488ABE-E593-46FB-9C63-32A687EEFE38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9488ABE-E593-46FB-9C63-32A687EEFE38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9488ABE-E593-46FB-9C63-32A687EEFE38}.Release|Any CPU.Build.0 = Release|Any CPU
{F14B85E6-725E-4F78-BDAB-0240DB573333}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F14B85E6-725E-4F78-BDAB-0240DB573333}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F14B85E6-725E-4F78-BDAB-0240DB573333}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F14B85E6-725E-4F78-BDAB-0240DB573333}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
branches:
master:
mode: ContinuousDeployment
tag: rc
Loading

0 comments on commit 316d3bd

Please sign in to comment.