diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 0345240..35006f4 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-sonarscanner": {
- "version": "4.8.0",
+ "version": "5.13.1",
"commands": [
"dotnet-sonarscanner"
]
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
new file mode 100644
index 0000000..5406574
--- /dev/null
+++ b/.github/workflows/pull-request.yml
@@ -0,0 +1,29 @@
+name: Pull Request
+
+on:
+ pull_request:
+ branches: ['master']
+
+jobs:
+ tests:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: |
+ 6
+ 7
+ - name: Build, Test and Sonar
+ uses: swisslife-oss/actions/pull-request@main
+ with:
+ sonar_token: ${{ secrets.SONAR_TOKEN }}
+ sonar_project_key: 'SwissLife-OSS_Mongo-Extensions'
+ sonar_project_name: "mongo-extensions"
+ pr_number: ${{ github.event.pull_request.number }}
+ pr_source_branch: ${{ github.head_ref }}
+ pr_target_branch: ${{ github.base_ref }}
+ github_repository: ${{ github.repository }}
+ sonar_exclusions: ${{ vars.SONAR_EXCLUSIONS }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..213b9d3
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,44 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - "*"
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ - name: Use .NET SDK from global.json
+ uses: actions/setup-dotnet@v3
+ - name: Build, Test and Push
+ uses: swisslife-oss/actions/release-packages@main
+ with:
+ tag: ${{ github.ref_name }}
+ nuget_api_key: ${{ secrets.NUGET_API_KEY }}
+ enable_push: 'yes'
+
+ sonar:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: |
+ 6
+ 7
+ - name: Restore tools
+ run: dotnet tool restore
+ - name: Build, Test and Sonar
+ uses: swisslife-oss/actions/release-sonar@main
+ with:
+ tag: ${{ github.ref_name }}
+ sonar_token: ${{ secrets.SONAR_TOKEN }}
+ sonar_project_key: 'SwissLife-OSS_Mongo-Extensions'
+ sonar_project_name: "mongo-extensions"
+ sonar_exclusions: ${{ vars.SONAR_EXCLUSIONS }}
diff --git a/Directory.Packages.props b/Directory.Packages.props
index cb39fc4..a953b83 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -6,14 +6,14 @@
-
-
-
+
+
+
-
+
diff --git a/src/Context.AllowedTypes.Tests/Helpers/TestHelpers.cs b/src/Context.AllowedTypes.Tests/Helpers/TestHelpers.cs
index 86d91bf..fad2d47 100644
--- a/src/Context.AllowedTypes.Tests/Helpers/TestHelpers.cs
+++ b/src/Context.AllowedTypes.Tests/Helpers/TestHelpers.cs
@@ -13,8 +13,11 @@ public static object GetTypeObjectSerializerContent()
AllowedTypes = TypeObjectSerializer.AllowedTypes
.Select(pair => new KeyValuePair(pair.Key.FullName, pair.Value))
.OrderBy(pair => pair.Key),
- TypeObjectSerializer.AllowedTypesByNamespaces,
- TypeObjectSerializer.AllowedTypesByDependencies
+ AllowedTypesByNamespaces = TypeObjectSerializer.AllowedTypesByNamespaces
+ .OrderBy(x => x),
+ AllowedTypesByDependencies = TypeObjectSerializer.AllowedTypesByDependencies
+ .Except(new[] { "Coverlet" })
+ .OrderBy(x => x)
};
}
}
diff --git a/src/Context.AllowedTypes.Tests/__snapshots__/MongoDatabaseBuilderTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap b/src/Context.AllowedTypes.Tests/__snapshots__/MongoDatabaseBuilderTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap
index 86c92ba..00b573e 100644
--- a/src/Context.AllowedTypes.Tests/__snapshots__/MongoDatabaseBuilderTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap
+++ b/src/Context.AllowedTypes.Tests/__snapshots__/MongoDatabaseBuilderTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap
@@ -2,26 +2,26 @@
"AllowedTypes": [],
"AllowedTypesByNamespaces": [],
"AllowedTypesByDependencies": [
- "Newtonsoft",
- "Internal",
- "Xunit",
- "NuGet",
- "MongoDB",
- "Squadron",
- "ThirdParty",
- "AWSSDK",
"Amazon",
+ "AWSSDK",
"Castle",
"DnsClient",
"Docker",
"FluentAssertions",
- "SharpCompress",
- "TypeNameFormatter",
+ "ICSharpCode",
+ "Internal",
+ "MongoDB",
"Moq",
+ "Newtonsoft",
+ "NuGet",
"Polly",
- "ICSharpCode",
+ "SharpCompress",
"Snappier",
"Snapshooter",
+ "Squadron",
+ "ThirdParty",
+ "TypeNameFormatter",
+ "Xunit",
"ZstdSharp"
]
}
diff --git a/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap b/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap
index 86c92ba..00b573e 100644
--- a/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap
+++ b/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.AddAllowedTypes_AddAllowedTypesOfAllDependencies_Success.snap
@@ -2,26 +2,26 @@
"AllowedTypes": [],
"AllowedTypesByNamespaces": [],
"AllowedTypesByDependencies": [
- "Newtonsoft",
- "Internal",
- "Xunit",
- "NuGet",
- "MongoDB",
- "Squadron",
- "ThirdParty",
- "AWSSDK",
"Amazon",
+ "AWSSDK",
"Castle",
"DnsClient",
"Docker",
"FluentAssertions",
- "SharpCompress",
- "TypeNameFormatter",
+ "ICSharpCode",
+ "Internal",
+ "MongoDB",
"Moq",
+ "Newtonsoft",
+ "NuGet",
"Polly",
- "ICSharpCode",
+ "SharpCompress",
"Snappier",
"Snapshooter",
+ "Squadron",
+ "ThirdParty",
+ "TypeNameFormatter",
+ "Xunit",
"ZstdSharp"
]
}
diff --git a/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.IsTypeAllowed_InAllowedTypesInDependencies_True.snap b/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.IsTypeAllowed_InAllowedTypesInDependencies_True.snap
index 25fdb9b..313d766 100644
--- a/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.IsTypeAllowed_InAllowedTypesInDependencies_True.snap
+++ b/src/Context.AllowedTypes.Tests/__snapshots__/TypeObjectSerializerTests.IsTypeAllowed_InAllowedTypesInDependencies_True.snap
@@ -7,26 +7,26 @@
],
"AllowedTypesByNamespaces": [],
"AllowedTypesByDependencies": [
- "Newtonsoft",
- "Internal",
- "Xunit",
- "NuGet",
- "MongoDB",
- "Squadron",
- "ThirdParty",
- "AWSSDK",
"Amazon",
+ "AWSSDK",
"Castle",
"DnsClient",
"Docker",
"FluentAssertions",
- "SharpCompress",
- "TypeNameFormatter",
+ "ICSharpCode",
+ "Internal",
+ "MongoDB",
"Moq",
+ "Newtonsoft",
+ "NuGet",
"Polly",
- "ICSharpCode",
+ "SharpCompress",
"Snappier",
"Snapshooter",
+ "Squadron",
+ "ThirdParty",
+ "TypeNameFormatter",
+ "Xunit",
"ZstdSharp"
]
}
diff --git a/src/Context.Tests/Internal/DependencyTypesResolverTests.cs b/src/Context.Tests/Internal/DependencyTypesResolverTests.cs
index 4978f80..415eca2 100644
--- a/src/Context.Tests/Internal/DependencyTypesResolverTests.cs
+++ b/src/Context.Tests/Internal/DependencyTypesResolverTests.cs
@@ -13,10 +13,12 @@ public void GetAllowedTypesByDependencies_All_Successful()
// Arrange
// Act
- IEnumerable knownNamespaces =
- DependencyTypesResolver.GetAllowedTypesByDependencies();
+ IEnumerable knownNamespaces = DependencyTypesResolver
+ .GetAllowedTypesByDependencies()
+ .Except(new[] { "Coverlet" })
+ .OrderBy(x => x);
// Assert
- Snapshot.Match(knownNamespaces.OrderBy(x => x));
+ Snapshot.Match(knownNamespaces);
}
}