From 4d89238e246d5a0521d6a93138fe5caadf3b30a6 Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 08:25:53 +0100
Subject: [PATCH 01/14] Update test.yml for coverage
---
.github/workflows/test.yml | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index d74ea19..2abe5d9 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -36,4 +36,24 @@ jobs:
run: dotnet build
- name: Test
- run: dotnet test
\ No newline at end of file
+ run: dotnet test
+
+ - name: Code Coverage Report
+ uses: irongut/CodeCoverageSummary@v1.3.0
+ with:
+ filename: coverage/**/coverage.cobertura.xml
+ badge: true
+ fail_below_min: true
+ format: markdown
+ hide_branch_rate: false
+ hide_complexity: true
+ indicators: true
+ output: both
+ thresholds: '60 80'
+
+ - name: Add Coverage PR Comment
+ uses: marocchino/sticky-pull-request-comment@v2
+ if: github.event_name == 'push'
+ with:
+ recreate: true
+ path: code-coverage-results.md
From 3c02ec8473286d43800d0c27ffeb45bd8196ca06 Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 08:31:49 +0100
Subject: [PATCH 02/14] Update test.yml
---
.github/workflows/test.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 2abe5d9..e1aa934 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -33,10 +33,10 @@ jobs:
run: dotnet restore
- name: Build
- run: dotnet build
+ run: dotnet build --configuration Release --no-restore
- name: Test
- run: dotnet test
+ run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
From c94d40b7e32ab3f616c8b4faa5d4361909d69e51 Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 08:59:27 +0100
Subject: [PATCH 03/14] Write code coverage summary on actions
---
.github/workflows/test.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index e1aa934..3c94c7a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -53,7 +53,9 @@ jobs:
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
- if: github.event_name == 'push'
with:
recreate: true
path: code-coverage-results.md
+
+ - name: Write to Job Summary
+ run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
\ No newline at end of file
From 8c83a2dd2a712c8c3100d64b0982a677d7461f7b Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 09:06:03 +0100
Subject: [PATCH 04/14] Pipeline with Code coverage summary
---
.github/workflows/pull_request.yml | 24 +++++++++++++++++++++++-
.github/workflows/release.yml | 22 ++++++++++++++++++++++
.github/workflows/test.yml | 2 +-
3 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 2e71314..960970d 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -39,4 +39,26 @@ jobs:
run: dotnet build
- name: Test
- run: dotnet test
\ No newline at end of file
+ run: dotnet test
+
+ - name: Code Coverage Report
+ uses: irongut/CodeCoverageSummary@v1.3.0
+ with:
+ filename: coverage/**/coverage.cobertura.xml
+ badge: true
+ fail_below_min: true
+ format: markdown
+ hide_branch_rate: false
+ hide_complexity: true
+ indicators: true
+ output: both
+ thresholds: '80 90'
+
+ - name: Add Coverage PR Comment
+ uses: marocchino/sticky-pull-request-comment@v2
+ with:
+ recreate: true
+ path: code-coverage-results.md
+
+ - name: Write to Job Summary
+ run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 7ec54c9..18008f8 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -36,6 +36,28 @@ jobs:
- name: Test
run: dotnet test -c Release --no-restore --no-build --verbosity normal --filter "Category!=LongRunning"
+ - name: Code Coverage Report
+ uses: irongut/CodeCoverageSummary@v1.3.0
+ with:
+ filename: coverage/**/coverage.cobertura.xml
+ badge: true
+ fail_below_min: true
+ format: markdown
+ hide_branch_rate: false
+ hide_complexity: true
+ indicators: true
+ output: both
+ thresholds: '80 90'
+
+ - name: Add Coverage PR Comment
+ uses: marocchino/sticky-pull-request-comment@v2
+ with:
+ recreate: true
+ path: code-coverage-results.md
+
+ - name: Write to Job Summary
+ run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
+
- name: Pack
run: dotnet pack GofPatterns/GofPatterns.csproj -c Release --no-restore --no-build --include-symbols -p:SymbolPackageFormat=snupkg -o .
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3c94c7a..bd03ab7 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -49,7 +49,7 @@ jobs:
hide_complexity: true
indicators: true
output: both
- thresholds: '60 80'
+ thresholds: '80 90'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
From ed2c9a128efe8550eebad17f837e4e5123cee8ac Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 09:11:25 +0100
Subject: [PATCH 05/14] Update README.md
---
README.md | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 07b7d75..5335c3b 100644
--- a/README.md
+++ b/README.md
@@ -53,4 +53,14 @@ just click on the link of the design pattern to go to the respective page of the
- [Factory](README/Creational/Factory.md)
- [Abstract Factory](README/Creational/AbstractFactory.md)
-- [Builder](README/Creational/Builder.md)
\ No newline at end of file
+- [Builder](README/Creational/Builder.md)
+
+
+## Code coverage
+
+- The code coverage is exceptional for the library, and the examples provided for each pattern
+- The library is tested for all the patterns, and the examples are also tested for the patterns they are demonstrating.
+
+### Result
+
+To view the coverage result please see the Actions tab of the repository.
\ No newline at end of file
From 814442088608d3f93e786a8c3213e07871ddb742 Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 09:17:36 +0100
Subject: [PATCH 06/14] Correct code coverage in pipelines
---
.github/workflows/pull_request.yml | 5 +++--
.github/workflows/release.yml | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 960970d..b75b356 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -36,10 +36,11 @@ jobs:
run: dotnet restore
- name: Build
- run: dotnet build
+ run: dotnet build --configuration Release --no-restore
- name: Test
- run: dotnet test
+ run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
+
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 18008f8..5f108ba 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -34,7 +34,7 @@ jobs:
run: dotnet build -c Release --no-restore
- name: Test
- run: dotnet test -c Release --no-restore --no-build --verbosity normal --filter "Category!=LongRunning"
+ run: dotnet test -c Release --no-restore --no-build --verbosity normal --filter "Category!=LongRunning" --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
From f7ffbf0901262c8451673640be3bdf35a5df6a79 Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 09:25:01 +0100
Subject: [PATCH 07/14] Update PR pipeline code coverage
---
.github/workflows/pull_request.yml | 53 ++++++++++++++++++------------
1 file changed, 32 insertions(+), 21 deletions(-)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index b75b356..ddb9b0b 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -39,27 +39,38 @@ jobs:
run: dotnet build --configuration Release --no-restore
- name: Test
- run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
+ run: dotnet test --configuration Release --no-build --verbosity normal
- - name: Code Coverage Report
- uses: irongut/CodeCoverageSummary@v1.3.0
- with:
- filename: coverage/**/coverage.cobertura.xml
- badge: true
- fail_below_min: true
- format: markdown
- hide_branch_rate: false
- hide_complexity: true
- indicators: true
- output: both
- thresholds: '80 90'
-
- - name: Add Coverage PR Comment
- uses: marocchino/sticky-pull-request-comment@v2
- with:
- recreate: true
- path: code-coverage-results.md
+ coverage:
- - name: Write to Job Summary
- run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
\ No newline at end of file
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Build
+ run: dotnet build -c Release --no-restore
+
+ - name: Test
+ run: dotnet test -c Release --no-restore --no-build --verbosity normal --filter "Category!=LongRunning" --collect:"XPlat Code Coverage" --results-directory ./coverage
+
+ - name: Code Coverage Report
+ uses: irongut/CodeCoverageSummary@v1.3.0
+ with:
+ filename: coverage/**/coverage.cobertura.xml
+ badge: true
+ fail_below_min: true
+ format: markdown
+ hide_branch_rate: false
+ hide_complexity: true
+ indicators: true
+ output: both
+ thresholds: '80 90'
+
+ - name: Add Coverage PR Comment
+ uses: marocchino/sticky-pull-request-comment@v2
+ with:
+ recreate: true
+ path: code-coverage-results.md
+
+ - name: Write to Job Summary
+ run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
\ No newline at end of file
From 4b16a11e6632de04017120fdc00cb355e4407e02 Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 09:27:19 +0100
Subject: [PATCH 08/14] Correct PR pipeline
---
.github/workflows/pull_request.yml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index ddb9b0b..f3c6d0b 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -47,6 +47,19 @@ jobs:
runs-on: ubuntu-latest
steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Install .NET Core
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 6.0.x
+
+ - name: Restore dependencies
+ run: dotnet restore
+
- name: Build
run: dotnet build -c Release --no-restore
From 1ba54e95f6e40ab00d5ab3683592a1fbb9879e44 Mon Sep 17 00:00:00 2001
From: viveksacademia4git
<45398326+viveksacademia4git@users.noreply.github.com>
Date: Mon, 5 Feb 2024 09:40:05 +0100
Subject: [PATCH 09/14] Update pipelines
---
.github/workflows/pull_request.yml | 65 +++++++++-----------
.github/workflows/release.yml | 96 +++++++++++++++++++-----------
.github/workflows/test.yml | 2 +-
GofPatterns/GofPatterns.csproj | 2 +-
4 files changed, 92 insertions(+), 73 deletions(-)
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index f3c6d0b..803827d 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -8,41 +8,7 @@ on:
jobs:
- test:
-
- strategy:
- matrix:
- configuration: [Debug]
- os: [windows-latest, ubuntu-latest]
-
- runs-on: ${{ matrix.os }}
-
- env:
- Solution_Name: GofPatterns.sln
- Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj
-
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- - name: Install .NET Core
- uses: actions/setup-dotnet@v3
- with:
- dotnet-version: 6.0.x
-
- - name: Restore dependencies
- run: dotnet restore
-
- - name: Build
- run: dotnet build --configuration Release --no-restore
-
- - name: Test
- run: dotnet test --configuration Release --no-build --verbosity normal
-
-
- coverage:
+ test-linux:
runs-on: ubuntu-latest
@@ -86,4 +52,31 @@ jobs:
path: code-coverage-results.md
- name: Write to Job Summary
- run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
\ No newline at end of file
+ run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
+
+
+ test-windows:
+ runs-on: windows-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Install .NET Core
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 6.0.x
+
+ - name: Setup MSBuild.exe
+ uses: microsoft/setup-msbuild@v1.0.2
+
+ - name: Restore dependencies
+ run: dotnet restore
+
+ - name: Build
+ run: dotnet build --configuration Release --no-restore
+
+ - name: Test
+ run: dotnet test --configuration Release --no-build --verbosity normal
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5f108ba..72b6c88 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -4,63 +4,89 @@ name: Release
on:
push:
branches:
- - 'main'
+ - '**' #'main'
jobs:
- release:
+ test:
- runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ configuration: [Release]
+ version: [6.0.x, 4.5.x]
- env:
- Solution_Name: GofPatterns.sln
- Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- - name: Install .NET Core
+ - name: Install .NET
uses: actions/setup-dotnet@v3
with:
- dotnet-version: 6.0.x
+ dotnet-version: ${{ matrix.version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
-
+
- name: Test
- run: dotnet test -c Release --no-restore --no-build --verbosity normal --filter "Category!=LongRunning" --collect:"XPlat Code Coverage" --results-directory ./coverage
+ run: dotnet test -c Release --no-restore --no-build --verbosity normal --filter "Category!=LongRunning"
- - name: Code Coverage Report
- uses: irongut/CodeCoverageSummary@v1.3.0
- with:
- filename: coverage/**/coverage.cobertura.xml
- badge: true
- fail_below_min: true
- format: markdown
- hide_branch_rate: false
- hide_complexity: true
- indicators: true
- output: both
- thresholds: '80 90'
-
- - name: Add Coverage PR Comment
- uses: marocchino/sticky-pull-request-comment@v2
- with:
- recreate: true
- path: code-coverage-results.md
- - name: Write to Job Summary
- run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
+ release:
+ needs: test
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Install .NET Core
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 6.0.x
+
+ - name: Restore dependencies
+ run: dotnet restore
+
+ - name: Build
+ run: dotnet build -c Release --no-restore
+
+ - name: Test
+ run: dotnet test -c Release --no-restore --no-build --verbosity normal --filter "Category!=LongRunning" --collect:"XPlat Code Coverage" --results-directory ./coverage
+
+ - name: Code Coverage Report
+ uses: irongut/CodeCoverageSummary@v1.3.0
+ with:
+ filename: coverage/**/coverage.cobertura.xml
+ badge: true
+ fail_below_min: true
+ format: markdown
+ hide_branch_rate: false
+ hide_complexity: true
+ indicators: true
+ output: both
+ thresholds: '80 90'
+
+ - name: Add Coverage PR Comment
+ uses: marocchino/sticky-pull-request-comment@v2
+ with:
+ recreate: true
+ path: code-coverage-results.md
+
+ - name: Write to Job Summary
+ run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
- - name: Pack
- run: dotnet pack GofPatterns/GofPatterns.csproj -c Release --no-restore --no-build --include-symbols -p:SymbolPackageFormat=snupkg -o .
+ - name: Pack
+ run: dotnet pack GofPatterns/GofPatterns.csproj -c Release --no-restore --no-build --include-symbols -p:SymbolPackageFormat=snupkg -o .
- # Push to NuGet
- - name: Deploy
- run: dotnet nuget push *.nupkg --skip-duplicate -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}
\ No newline at end of file
+ # Push to NuGet
+ - name: Deploy
+ run: dotnet nuget push *.nupkg --skip-duplicate -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}
\ No newline at end of file
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index bd03ab7..5dca75b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -5,7 +5,7 @@ on:
push:
branches:
- '**'
- - '!master'
+ - '!main'
- '!dev'
jobs:
diff --git a/GofPatterns/GofPatterns.csproj b/GofPatterns/GofPatterns.csproj
index e74986c..6596578 100644
--- a/GofPatterns/GofPatterns.csproj
+++ b/GofPatterns/GofPatterns.csproj
@@ -10,7 +10,7 @@