From 9601ab6bfd0e0a24a952e8fe199fb2aa551e59c0 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:55:17 -0400 Subject: [PATCH 1/4] Explicitly set the report to go to PR --- .github/workflows/testing-from-build.yml | 1 + .github/workflows/testing-from-ghcr.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/testing-from-build.yml b/.github/workflows/testing-from-build.yml index bbfce05638..ac7bbdc2c6 100644 --- a/.github/workflows/testing-from-build.yml +++ b/.github/workflows/testing-from-build.yml @@ -49,6 +49,7 @@ jobs: - name: Publish Coverage Report to Pull Request uses: 5monkeys/cobertura-action@master + if: github.event_name == 'pull_request' with: path: ./coverage.xml minimum_coverage: 85 diff --git a/.github/workflows/testing-from-ghcr.yml b/.github/workflows/testing-from-ghcr.yml index 6c7a5d4c3d..1adbf404c3 100644 --- a/.github/workflows/testing-from-ghcr.yml +++ b/.github/workflows/testing-from-ghcr.yml @@ -51,6 +51,7 @@ jobs: - name: Publish Coverage Report to Pull Request uses: 5monkeys/cobertura-action@master + if: github.event_name == 'pull_request' with: path: ./coverage.xml minimum_coverage: 85 From 34ee193823c216bf9bcc9b7f1bc638b418470f53 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:57:50 -0400 Subject: [PATCH 2/4] backing out --- .github/workflows/testing-from-ghcr.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/testing-from-ghcr.yml b/.github/workflows/testing-from-ghcr.yml index 1adbf404c3..98379c5a11 100644 --- a/.github/workflows/testing-from-ghcr.yml +++ b/.github/workflows/testing-from-ghcr.yml @@ -51,14 +51,12 @@ jobs: - name: Publish Coverage Report to Pull Request uses: 5monkeys/cobertura-action@master - if: github.event_name == 'pull_request' with: path: ./coverage.xml minimum_coverage: 85 skip_covered: true # Set to true to remove 100% covered from report fail_below_threshold: false # Fails the action if 90% threshold is not met show_missing: true - only_changed_files: true repo_token: ${{ secrets.GITHUB_TOKEN }} # a11y-testing: From e44e7045595ca22ac7889015c8447885a9f8eba1 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:03:15 -0400 Subject: [PATCH 3/4] Test a new coverage tool --- .github/workflows/testing-from-build.yml | 33 ++++++++++++++++++------ .github/workflows/testing-from-ghcr.yml | 33 +++++++++++++++++++----- 2 files changed, 51 insertions(+), 15 deletions(-) diff --git a/.github/workflows/testing-from-build.yml b/.github/workflows/testing-from-build.yml index ac7bbdc2c6..70af51098c 100644 --- a/.github/workflows/testing-from-build.yml +++ b/.github/workflows/testing-from-build.yml @@ -47,17 +47,34 @@ jobs: pwd ls -al | grep 'coverage' - - name: Publish Coverage Report to Pull Request - uses: 5monkeys/cobertura-action@master + - name: Produce the coverage report + uses: insightsengineering/coverage-action@v2 if: github.event_name == 'pull_request' with: + # Path to the Cobertura XML report. path: ./coverage.xml - minimum_coverage: 85 - skip_covered: true # Set to true to remove 100% covered from report - fail_below_threshold: false # Fails the action if 90% threshold is not met - show_missing: true - only_changed_files: true - repo_token: ${{ secrets.GITHUB_TOKEN }} + # Minimum total coverage, if you want to the + # workflow to enforce it as a standard. + # This has no effect if the `fail` arg is set to `false`. + threshold: 85 + # Fail the workflow if the minimum code coverage + # reuqirements are not satisfied. + fail: false + # Publish the rendered output as a PR comment + publish: true + # Create a coverage diff report. + diff: true + # Branch to diff against. + # Compare the current coverage to the coverage + # determined on this branch. + diff-branch: main + # This is where the coverage reports for the + # `diff-branch` are stored. + # Branch is created if it doesn't already exist'. + # diff-storage: _xml_coverage_reports + # A custom title that can be added to the code + # coverage summary in the PR comment. + coverage-summary-title: "Code Coverage Summary" # a11y-testing: # runs-on: ubuntu-latest diff --git a/.github/workflows/testing-from-ghcr.yml b/.github/workflows/testing-from-ghcr.yml index 98379c5a11..3c23bf0004 100644 --- a/.github/workflows/testing-from-ghcr.yml +++ b/.github/workflows/testing-from-ghcr.yml @@ -49,15 +49,34 @@ jobs: pwd ls -al | grep 'coverage' - - name: Publish Coverage Report to Pull Request - uses: 5monkeys/cobertura-action@master + - name: Produce the coverage report + uses: insightsengineering/coverage-action@v2 + if: github.event_name == 'pull_request' with: + # Path to the Cobertura XML report. path: ./coverage.xml - minimum_coverage: 85 - skip_covered: true # Set to true to remove 100% covered from report - fail_below_threshold: false # Fails the action if 90% threshold is not met - show_missing: true - repo_token: ${{ secrets.GITHUB_TOKEN }} + # Minimum total coverage, if you want to the + # workflow to enforce it as a standard. + # This has no effect if the `fail` arg is set to `false`. + threshold: 85 + # Fail the workflow if the minimum code coverage + # reuqirements are not satisfied. + fail: false + # Publish the rendered output as a PR comment + publish: true + # Create a coverage diff report. + diff: true + # Branch to diff against. + # Compare the current coverage to the coverage + # determined on this branch. + diff-branch: main + # This is where the coverage reports for the + # `diff-branch` are stored. + # Branch is created if it doesn't already exist'. + # diff-storage: _xml_coverage_reports + # A custom title that can be added to the code + # coverage summary in the PR comment. + coverage-summary-title: "Code Coverage Summary" # a11y-testing: # runs-on: ubuntu-latest From 91883618dc5ed97096c8f8af553eb78fe9798fc9 Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:33:48 -0400 Subject: [PATCH 4/4] Swap coverage actions --- .github/workflows/testing-from-build.yml | 30 ++++-------------------- .github/workflows/testing-from-ghcr.yml | 30 ++++-------------------- 2 files changed, 8 insertions(+), 52 deletions(-) diff --git a/.github/workflows/testing-from-build.yml b/.github/workflows/testing-from-build.yml index 70af51098c..647b3897ff 100644 --- a/.github/workflows/testing-from-build.yml +++ b/.github/workflows/testing-from-build.yml @@ -47,34 +47,12 @@ jobs: pwd ls -al | grep 'coverage' - - name: Produce the coverage report - uses: insightsengineering/coverage-action@v2 + - name: Coverage Action if: github.event_name == 'pull_request' + uses: orgoro/coverage@v3.1 with: - # Path to the Cobertura XML report. - path: ./coverage.xml - # Minimum total coverage, if you want to the - # workflow to enforce it as a standard. - # This has no effect if the `fail` arg is set to `false`. - threshold: 85 - # Fail the workflow if the minimum code coverage - # reuqirements are not satisfied. - fail: false - # Publish the rendered output as a PR comment - publish: true - # Create a coverage diff report. - diff: true - # Branch to diff against. - # Compare the current coverage to the coverage - # determined on this branch. - diff-branch: main - # This is where the coverage reports for the - # `diff-branch` are stored. - # Branch is created if it doesn't already exist'. - # diff-storage: _xml_coverage_reports - # A custom title that can be added to the code - # coverage summary in the PR comment. - coverage-summary-title: "Code Coverage Summary" + coverageFile: ./coverage.xml + token: ${{ secrets.GITHUB_TOKEN }} # a11y-testing: # runs-on: ubuntu-latest diff --git a/.github/workflows/testing-from-ghcr.yml b/.github/workflows/testing-from-ghcr.yml index 3c23bf0004..009a390b85 100644 --- a/.github/workflows/testing-from-ghcr.yml +++ b/.github/workflows/testing-from-ghcr.yml @@ -49,34 +49,12 @@ jobs: pwd ls -al | grep 'coverage' - - name: Produce the coverage report - uses: insightsengineering/coverage-action@v2 + - name: Coverage Action if: github.event_name == 'pull_request' + uses: orgoro/coverage@v3.1 with: - # Path to the Cobertura XML report. - path: ./coverage.xml - # Minimum total coverage, if you want to the - # workflow to enforce it as a standard. - # This has no effect if the `fail` arg is set to `false`. - threshold: 85 - # Fail the workflow if the minimum code coverage - # reuqirements are not satisfied. - fail: false - # Publish the rendered output as a PR comment - publish: true - # Create a coverage diff report. - diff: true - # Branch to diff against. - # Compare the current coverage to the coverage - # determined on this branch. - diff-branch: main - # This is where the coverage reports for the - # `diff-branch` are stored. - # Branch is created if it doesn't already exist'. - # diff-storage: _xml_coverage_reports - # A custom title that can be added to the code - # coverage summary in the PR comment. - coverage-summary-title: "Code Coverage Summary" + coverageFile: ./coverage.xml + token: ${{ secrets.GITHUB_TOKEN }} # a11y-testing: # runs-on: ubuntu-latest