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 @@ True GofPatterns Gof Patterns - 1.3.3 + 1.3.2 viveksacademia vivopensource Desgin Patterns for C# (Gang of Four) From 1664578403332a54d28b8b87199635406f105029 Mon Sep 17 00:00:00 2001 From: viveksacademia4git <45398326+viveksacademia4git@users.noreply.github.com> Date: Mon, 5 Feb 2024 09:49:00 +0100 Subject: [PATCH 10/14] Test release pipeline --- .github/workflows/pull_request.yml | 8 ++- .github/workflows/release.yml | 36 ++------------ .github/workflows/test.yml | 80 +++++++++++++++--------------- 3 files changed, 51 insertions(+), 73 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 803827d..ad9b6ec 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,6 +12,10 @@ jobs: runs-on: ubuntu-latest + env: + Solution_Name: GofPatterns.sln + Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj + steps: - name: Checkout uses: actions/checkout@v3 @@ -27,10 +31,10 @@ jobs: run: dotnet restore - name: Build - run: dotnet build -c Release --no-restore + run: dotnet build --configuration 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 --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 72b6c88..2719c05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,45 +4,19 @@ name: Release on: push: branches: - - '**' #'main' + - '**' jobs: - test: - - strategy: - matrix: - configuration: [Release] - version: [6.0.x, 4.5.x] - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install .NET - uses: actions/setup-dotnet@v3 - with: - 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" - - release: - needs: test runs-on: ubuntu-latest + env: + Solution_Name: GofPatterns.sln + Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj + steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5dca75b..149d4ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,43 +19,43 @@ jobs: 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 --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 + - 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 --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 85d28ad4ccc114dfe28869e670493761d1212a4c Mon Sep 17 00:00:00 2001 From: viveksacademia4git <45398326+viveksacademia4git@users.noreply.github.com> Date: Mon, 5 Feb 2024 09:53:50 +0100 Subject: [PATCH 11/14] Correct pipelines --- .github/workflows/pull_request.yml | 44 +++++++++--------------------- .github/workflows/test.yml | 4 +-- 2 files changed, 15 insertions(+), 33 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ad9b6ec..7350b05 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,9 +8,9 @@ on: jobs: - test-linux: + test-windows: - runs-on: ubuntu-latest + runs-on: windows-latest env: Solution_Name: GofPatterns.sln @@ -27,14 +27,17 @@ jobs: 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 + run: dotnet build --configuration Debug --no-restore - name: Test - run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test --configuration Debug --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 @@ -57,30 +60,9 @@ jobs: - name: Write to Job Summary 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 + + # Restore the application to populate the obj folder with RuntimeIdentifiers + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration + env: + Configuration: Debug diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 149d4ee..1ccea02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,10 +33,10 @@ jobs: run: dotnet restore - name: Build - run: dotnet build --configuration Release --no-restore + run: dotnet build --configuration Debug --no-restore - name: Test - run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test --configuration Debug --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 From 71ee08649cd5cdf4887b3a4db8bb43f3f84dec56 Mon Sep 17 00:00:00 2001 From: viveksacademia4git <45398326+viveksacademia4git@users.noreply.github.com> Date: Mon, 5 Feb 2024 09:59:10 +0100 Subject: [PATCH 12/14] Correct pipeline --- .github/workflows/pull_request.yml | 15 +++------------ .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 2 +- GofPatterns/GofPatterns.csproj | 2 +- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7350b05..cf0aa8c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,9 +8,9 @@ on: jobs: - test-windows: + test-pr: - runs-on: windows-latest + runs-on: ubuntu-latest env: Solution_Name: GofPatterns.sln @@ -27,9 +27,6 @@ jobs: with: dotnet-version: 6.0.x - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.0.2 - - name: Restore dependencies run: dotnet restore @@ -52,7 +49,7 @@ jobs: output: both thresholds: '80 90' - - name: Add Coverage PR Comment + - name: Code Coverage Result MD uses: marocchino/sticky-pull-request-comment@v2 with: recreate: true @@ -60,9 +57,3 @@ jobs: - name: Write to Job Summary run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY - - # Restore the application to populate the obj folder with RuntimeIdentifiers - - name: Restore the application - run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration - env: - Configuration: Debug diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2719c05..cc8d750 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ name: Release on: push: branches: - - '**' + - 'main' jobs: @@ -49,7 +49,7 @@ jobs: output: both thresholds: '80 90' - - name: Add Coverage PR Comment + - name: Code Coverage Result MD uses: marocchino/sticky-pull-request-comment@v2 with: recreate: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ccea02..52f68da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: - name: Test run: dotnet test --configuration Debug --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage - - name: Code Coverage Report + - name: Code Coverage Result MD uses: irongut/CodeCoverageSummary@v1.3.0 with: filename: coverage/**/coverage.cobertura.xml diff --git a/GofPatterns/GofPatterns.csproj b/GofPatterns/GofPatterns.csproj index 6596578..e74986c 100644 --- a/GofPatterns/GofPatterns.csproj +++ b/GofPatterns/GofPatterns.csproj @@ -10,7 +10,7 @@ True GofPatterns Gof Patterns - 1.3.2 + 1.3.3 viveksacademia vivopensource Desgin Patterns for C# (Gang of Four) From bb80aa1217ce9e345b98e0470eb79574acbcbd6b Mon Sep 17 00:00:00 2001 From: viveksacademia4git <45398326+viveksacademia4git@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:02:19 +0100 Subject: [PATCH 13/14] Merge test and PR pipelines --- .github/workflows/pull_request.yml | 59 ------------------------------ .github/workflows/test.yml | 3 ++ 2 files changed, 3 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index cf0aa8c..0000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,59 +0,0 @@ - -name: Pull Request - -on: - pull_request: - branches: - - 'dev' - -jobs: - - test-pr: - - runs-on: ubuntu-latest - - 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 Debug --no-restore - - - name: Test - run: dotnet test --configuration Debug --no-build --verbosity normal --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: Code Coverage Result MD - 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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52f68da..50f3604 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,9 @@ on: - '**' - '!main' - '!dev' + pull_request: + branches: + - 'dev' jobs: From 24ec8c50ae8d4962cb66722f73a036880658a9d2 Mon Sep 17 00:00:00 2001 From: viveksacademia4git <45398326+viveksacademia4git@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:16:13 +0100 Subject: [PATCH 14/14] Update pipelines --- .github/workflows/pull_request.yml | 95 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 1 - .github/workflows/test.yml | 5 +- 3 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..e8fdd6f --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,95 @@ + +name: Pull Request + +on: + pull_request: + branches: + - 'dev' + +jobs: + + test-linux: + + runs-on: ubuntu-latest + + 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 Debug --no-restore + + - name: Test + run: dotnet test --configuration Debug --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + + - name: Code Coverage Result MD + 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: Code Coverage Result MD + 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 + + test-windows: + + runs-on: windows-latest + + 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: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build + + - name: Test + run: dotnet test + + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration + env: + Configuration: Debug diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc8d750..8d41d55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,6 @@ on: branches: - 'main' - jobs: release: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50f3604..f1384b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,9 +7,6 @@ on: - '**' - '!main' - '!dev' - pull_request: - branches: - - 'dev' jobs: @@ -54,7 +51,7 @@ jobs: output: both thresholds: '80 90' - - name: Add Coverage PR Comment + - name: Code Coverage Result MD uses: marocchino/sticky-pull-request-comment@v2 with: recreate: true