Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci+docs: workflow cosmetics #130

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading