Skip to content

Commit

Permalink
ci+docs: workflow cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
vladopajic committed Nov 22, 2024
1 parent 97dd903 commit 4540b9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ jobs:
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
breakdown-file-name: ${{ github.ref_name == 'main' && 'main.breakdown' || '' }}
diff-base-breakdown-file-name: ${{ steps.download-main-breakdown.outputs.found_artifact && 'main.breakdown' || '' }}


- name: upload artifact (main.breakdown)
uses: actions/upload-artifact@v4
if: github.ref_name == 'main'
with:
name: main.breakdown
path: main.breakdown
if-no-files-found: error

# Post coverage report as comment
- name: find pull request ID
run: |
Expand Down Expand Up @@ -99,22 +107,13 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ env.pull_request_id }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
go-test-coverage report:
```
${{ fromJSON(steps.coverage.outputs.report) }}
```
edit-mode: replace
${{ fromJSON(steps.coverage.outputs.report) }}```
- name: "finally check coverage"
if: steps.coverage.outcome == 'failure'
shell: bash
run: echo "coverage check failed" && exit 1

- name: upload artifact (main.breakdown)
uses: actions/upload-artifact@v4
if: github.ref_name == 'main'
with:
name: main.breakdown
path: main.breakdown
if-no-files-found: error
6 changes: 3 additions & 3 deletions docs/github_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Example of report that includes coverage difference is [this PR](https://github.
branch: main
workflow_conclusion: success
name: main.breakdown
if_no_artifact_found: warn
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
Expand Down Expand Up @@ -135,12 +136,11 @@ Example of report is in [this PR](https://github.com/vladopajic/go-test-coverage
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ env.pull_request_id }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
go-test-coverage report:
```
${{ fromJSON(steps.coverage.outputs.report) }}
```
edit-mode: replace
${{ fromJSON(steps.coverage.outputs.report) }} ```
- name: "finally check coverage"
if: steps.coverage.outcome == 'failure'
Expand Down

0 comments on commit 4540b9b

Please sign in to comment.