From 4aee11054f406a8c6dbf1c47170402ddf475feca Mon Sep 17 00:00:00 2001 From: izzydotexe Date: Tue, 8 Oct 2024 20:47:02 -0400 Subject: [PATCH 1/4] add testing and build pipeline --- .github/workflows/dotnet.yml | 35 +++++++++++++++++++++++++++++++++++ ARC3Test/ARC3Test.csproj | 4 ---- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..022d921 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,35 @@ +name: dotnet package + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + dotnet-version: [ '8.0.x' ] + + steps: + - uses: actions/checkout@v4 + - name: Setup Dotnet ${{ matrix.dotnet-version }} + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ matrix.dotnet-version }} + - name: Install Deps + run: dotnet restore + - name: Build + run: dotnet build + - name: Test + run: dotnet test --collect:"XPlat Code Coverage;Format=json,lcov,cobertura" --results-directory:"Results" + - name: Coverage + uses: 5monkeys/cobertura-action@master + with: + path: Results/*/coverage.cobertura.xml + minimum_coverage: 80 \ No newline at end of file diff --git a/ARC3Test/ARC3Test.csproj b/ARC3Test/ARC3Test.csproj index 95c68a3..d389c1d 100644 --- a/ARC3Test/ARC3Test.csproj +++ b/ARC3Test/ARC3Test.csproj @@ -7,10 +7,6 @@ false true - true - lcov - ./lcov.info - From e6ba8475d4ebd75cf87e80790439e1e22698cee1 Mon Sep 17 00:00:00 2001 From: Izzy Aristide <44146685+IzzyDotExe@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:53:53 -0400 Subject: [PATCH 2/4] Update dotnet.yml --- .github/workflows/dotnet.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 022d921..0b5305f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -28,8 +28,22 @@ jobs: run: dotnet build - name: Test run: dotnet test --collect:"XPlat Code Coverage;Format=json,lcov,cobertura" --results-directory:"Results" - - name: Coverage - uses: 5monkeys/cobertura-action@master + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 with: - path: Results/*/coverage.cobertura.xml - minimum_coverage: 80 \ No newline at end of file + filename: Results/**/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 == 'pull_request' + with: + recreate: true + path: code-coverage-results.md From 667cf07c4b1a072bf663bb5fb6b7f44c833f21e5 Mon Sep 17 00:00:00 2001 From: Izzy Aristide <44146685+IzzyDotExe@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:04:26 -0400 Subject: [PATCH 3/4] Update dotnet.yml --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0b5305f..0dee235 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -33,13 +33,13 @@ jobs: with: filename: Results/**/coverage.cobertura.xml badge: true - fail_below_min: true + fail_below_min: false format: markdown hide_branch_rate: false hide_complexity: true indicators: true output: both - thresholds: '60 80' + thresholds: '0' - name: Add Coverage PR Comment uses: marocchino/sticky-pull-request-comment@v2 From 298ae4fa6576f41214611e8e745c95539d3d25a2 Mon Sep 17 00:00:00 2001 From: Izzy Aristide <44146685+IzzyDotExe@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:09:48 -0400 Subject: [PATCH 4/4] fix pipeline --- .github/workflows/dotnet.yml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0dee235..49bffed 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -10,7 +10,10 @@ on: jobs: build: - + permissions: + pull-requests: write + contents: read + runs-on: ubuntu-latest strategy: matrix: @@ -28,22 +31,8 @@ jobs: run: dotnet build - name: Test run: dotnet test --collect:"XPlat Code Coverage;Format=json,lcov,cobertura" --results-directory:"Results" - - name: Code Coverage Report - uses: irongut/CodeCoverageSummary@v1.3.0 - with: - filename: Results/**/coverage.cobertura.xml - badge: true - fail_below_min: false - format: markdown - hide_branch_rate: false - hide_complexity: true - indicators: true - output: both - thresholds: '0' - - - name: Add Coverage PR Comment - uses: marocchino/sticky-pull-request-comment@v2 - if: github.event_name == 'pull_request' + - name: Coverage + uses: 5monkeys/cobertura-action@master with: - recreate: true - path: code-coverage-results.md + path: Results/*/coverage.cobertura.xml + minimum_coverage: 80 \ No newline at end of file