Skip to content

Commit

Permalink
debug: not showing coverage in pr comment
Browse files Browse the repository at this point in the history
Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
  • Loading branch information
gouravkrosx committed May 1, 2024
1 parent 2615524 commit e454a22
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 52 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/comment_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Comment Coverage on PR
# name: Comment Coverage on PR

on:
workflow_call:
inputs:
issue-number:
required: true
type: number
artifact-url:
required: true
type: string
# on:
# workflow_call:
# inputs:
# issue-number:
# required: true
# type: number
# artifact-url:
# required: true
# type: string

# permissions:
# pull-requests: write
# issues: write
# # permissions:
# # pull-requests: write
# # issues: write

jobs:
comment-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
# jobs:
# comment-coverage:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

- name: Comment HTML report on PR
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ inputs.issue-number }}
body: |
Coverage report is available [here](${{inputs.artifact-url}}). Navigate to 'Artifacts' to download the HTML report.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Comment HTML report on PR
# uses: peter-evans/create-or-update-comment@v1
# with:
# issue-number: ${{ inputs.issue-number }}
# body: |
# Coverage report is available [here](${{inputs.artifact-url}}). Navigate to 'Artifacts' to download the HTML report.
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 25 additions & 25 deletions .github/workflows/coverage_stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,30 @@ jobs:
run: |
go tool cover -func total-coverage.txt
- name: Generate the HTML coverage report
run: |
go tool cover -html=total-coverage.txt -o=coverage.html
# - name: Generate the HTML coverage report
# run: |
# go tool cover -html=total-coverage.txt -o=coverage.html

- name: Upload the HTML coverage report
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: coverage-report-html
path: coverage.html
# - name: Upload the HTML coverage report
# id: artifact-upload-step
# uses: actions/upload-artifact@v4
# with:
# name: coverage-report-html
# path: coverage.html

- name: Comment Coverage on PR
if: success()
runs-on: ubuntu-latest
steps:
- name: Trigger Comment Workflow
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.actions.workflowDispatch({
workflow_file: '.github/workflows/comment_coverage.yml',
inputs: {
issue-number: ${{ github.event.client_payload.issue-number }},
artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
}
})
# - name: Comment Coverage on PR
# if: success()
# runs-on: ubuntu-latest
# steps:
# - name: Trigger Comment Workflow
# uses: actions/github-script@v7
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# await github.actions.workflowDispatch({
# workflow_file: '.github/workflows/comment_coverage.yml',
# inputs: {
# issue-number: ${{ github.event.client_payload.issue-number }},
# artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
# }
# })

0 comments on commit e454a22

Please sign in to comment.