From 8f0b7378e694920ce735d57bf1395422ea222260 Mon Sep 17 00:00:00 2001 From: Igor Sinicyn Date: Wed, 1 Jul 2026 19:53:39 +0300 Subject: [PATCH 1/4] Add PR workflow --- .github/workflows/pr.yml | 24 ++++++++++++++++++++++++ Directory.Packages.props | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..3a313a6 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,24 @@ +name: .NET + +# Trigger build and test whenever a pull request is opened or updated against target branches +on: + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/Directory.Packages.props b/Directory.Packages.props index d1a7fe9..b47c87d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,4 +1,5 @@ + true @@ -13,4 +14,5 @@ + From 3361702f61b192bd5e89509fee2d0528b49fdb96 Mon Sep 17 00:00:00 2001 From: Igor Sinicyn Date: Wed, 1 Jul 2026 20:11:16 +0300 Subject: [PATCH 2/4] Add test reporter --- .github/workflows/pr.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3a313a6..29b6c37 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,14 +11,28 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x + - name: Restore dependencies run: dotnet restore + - name: Build run: dotnet build --no-restore + - name: Test - run: dotnet test --no-build --verbosity normal + run: dotnet test --no-build --logger "trx;LogFileName=test-results.trx" || true + + - name: Test Report + uses: dorny/test-reporter@v1 + if: always() + with: + name: .NET Core Tests + path: "**/test-results.trx" + reporter: dotnet-trx + fail-on-error: true From d1c0b37b184cf6c58bf4175947c76cf2d512e0f1 Mon Sep 17 00:00:00 2001 From: Igor Sinicyn Date: Thu, 2 Jul 2026 22:05:44 +0300 Subject: [PATCH 3/4] Add xUnit v3/MTPv2 support --- .github/workflows/pr.yml | 2 +- CodeMe.sln.DotSettings | 12 ++++-------- Directory.Build.props | 15 +++++++++------ Directory.Packages.props | 14 +++++++------- global.json | 5 +++++ .../ServiceErrorFactoryBuilderHelper.cs | 4 ++++ .../CodeMe.ServiceErrors.UnitTests.csproj | 4 ++++ 7 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 global.json diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 29b6c37..05dd577 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,7 +26,7 @@ jobs: run: dotnet build --no-restore - name: Test - run: dotnet test --no-build --logger "trx;LogFileName=test-results.trx" || true + run: dotnet test --report-trx --results-directory=".artifacts/test-results" || true - name: Test Report uses: dorny/test-reporter@v1 diff --git a/CodeMe.sln.DotSettings b/CodeMe.sln.DotSettings index 4656a7b..246aa73 100644 --- a/CodeMe.sln.DotSettings +++ b/CodeMe.sln.DotSettings @@ -1,15 +1,11 @@ - + HINT - SUGGESTION + SUGGESTION True <?xml version="1.0" encoding="utf-16"?><Profile name="Cleanup on Save"><CSCodeStyleAttributes ArrangeVarStyle="True" ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" ArrangeAccessors="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeCodeBodyStyle="True" ArrangeTrailingCommas="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeEmptyString="True" ArrangeNamespaces="True" ArrangeNullCheckingPattern="True" /><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><XMLReformatCode>True</XMLReformatCode><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSharpReformatComments>True</CSharpReformatComments><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><RemoveCodeRedundancies>True</RemoveCodeRedundancies></Profile> Required ZeroIndent False - <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"><ElementKinds><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="_" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"><ElementKinds><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="_" Suffix="" Style="aaBb" /></Policy> + False \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 033a899..ed7f581 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -41,14 +41,17 @@ + + Exe + true + true + + - - - - - - + + + diff --git a/Directory.Packages.props b/Directory.Packages.props index b47c87d..d685286 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,18 +1,18 @@ - true - - - - - - + + + + + + + \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 0000000..8f73781 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} \ No newline at end of file diff --git a/src/CodeMe.ServiceErrors/Serializable.Builders/ServiceErrorFactoryBuilderHelper.cs b/src/CodeMe.ServiceErrors/Serializable.Builders/ServiceErrorFactoryBuilderHelper.cs index 3a33491..676a1a9 100644 --- a/src/CodeMe.ServiceErrors/Serializable.Builders/ServiceErrorFactoryBuilderHelper.cs +++ b/src/CodeMe.ServiceErrors/Serializable.Builders/ServiceErrorFactoryBuilderHelper.cs @@ -31,6 +31,10 @@ private static IEnumerable FlattenReferences( { yield return current; } + else + { + yield break; + } foreach (var referencedAssemblyName in current.GetReferencedAssemblies()) { diff --git a/tests/CodeMe.ServiceErrors.UnitTests/CodeMe.ServiceErrors.UnitTests.csproj b/tests/CodeMe.ServiceErrors.UnitTests/CodeMe.ServiceErrors.UnitTests.csproj index 4077e5c..ec6b1d6 100644 --- a/tests/CodeMe.ServiceErrors.UnitTests/CodeMe.ServiceErrors.UnitTests.csproj +++ b/tests/CodeMe.ServiceErrors.UnitTests/CodeMe.ServiceErrors.UnitTests.csproj @@ -4,4 +4,8 @@ net10.0 + + + + \ No newline at end of file From adf6e833384bc8346547e4222975fba6c09e88f4 Mon Sep 17 00:00:00 2001 From: Igor Sinicyn Date: Fri, 3 Jul 2026 20:26:14 +0300 Subject: [PATCH 4/4] Add xUnit v3/MTPv2 support --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 05dd577..7c587a6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -33,6 +33,6 @@ jobs: if: always() with: name: .NET Core Tests - path: "**/test-results.trx" + path: ".artifacts/test-results/**/*.trx" reporter: dotnet-trx fail-on-error: true