Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
PavanMudigonda committed Jan 1, 2024
1 parent d693304 commit 6832252
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
jobs:
test:
runs-on: ubuntu-latest
steps:

# generates coverage-report.md and publishes as checkrun
- name: JaCoCo Code Coverage Report
id: jacoco_reporter
uses: PavanMudigonda/[email protected]
with:
coverage_results_path: jacoco-report/test.xml
coverage_report_name: Coverage
coverage_report_title: JaCoCo
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_check_run: false
minimum_coverage: 80
fail_below_threshold: false
publish_only_summary: false

# Publish Coverage Job Summary # Optional
- name: Add Coverage Job Summary
run: echo "${{ steps.jacoco_reporter.outputs.coverageSummary }}" >> $GITHUB_STEP_SUMMARY

# uploads the coverage-report.md artifact # Optional

- name: Upload Code Coverage Artifacts
uses: actions/upload-artifact@v2
with:
name: code-coverage-report-markdown
path: */coverage-results.md
retention-days: 1
12 changes: 6 additions & 6 deletions action.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ if ($inputs.skip_check_run -ne $true -and $inputs.publish_only_summary -eq $true

Enforce-QualityGate

# Set-ActionOutput -Name coverageSummary -Value $script:coverageSummaryData
Set-ActionOutput -Name coverageSummary -Value $script:coverageSummaryData
}
elseif ($inputs.skip_check_run -ne $true -and $inputs.publish_only_summary -ne $true )
{
Expand All @@ -391,7 +391,7 @@ elseif ($inputs.skip_check_run -ne $true -and $inputs.publish_only_summary -ne $
# Update-PRCheck -ReportData $script:coverageSummaryData -ReportName $coverage_report_name -ReportTitle $script:messageToDisplay

Enforce-QualityGate
# Set-ActionOutput -Name coverageSummary -Value $script:coverageSummaryData
Set-ActionOutput -Name coverageSummary -Value $script:coverageSummaryData

}
elseif ($inputs.skip_check_run -eq $true -and $inputs.publish_only_summary -eq $true )
Expand All @@ -409,10 +409,10 @@ elseif ($inputs.skip_check_run -eq $true -and $inputs.publish_only_summary -eq $

Set-Output

# $coverageSummary = [System.IO.File]::ReadAllText($script:coverage_summary_path)
$coverageSummary = [System.IO.File]::ReadAllText($script:coverage_summary_path)

Enforce-QualityGate
# Set-ActionOutput -Name coverageSummary -Value $script:coverageSummary
Set-ActionOutput -Name coverageSummary -Value $script:coverageSummary
}
else {
Build-CoverageReport
Expand All @@ -427,10 +427,10 @@ else {

Set-Output

# $coverageSummary = [System.IO.File]::ReadAllText($script:coverage_summary_path)
$coverageSummary = [System.IO.File]::ReadAllText($script:coverage_summary_path)

Enforce-QualityGate

# Set-ActionOutput -Name coverageSummary -Value $script:coverageSummary
Set-ActionOutput -Name coverageSummary -Value $script:coverageSummary
}

0 comments on commit 6832252

Please sign in to comment.