story(issue-329): add type constraint for otel middleware #362
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate code coverage badge | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**.go' | |
permissions: | |
contents: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Update coverage badge | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Setup go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Run Test | |
# re-enable new coverage flow once this issue is resolved, https://github.com/golang/go/issues/65570 | |
run: | | |
GOEXPERIMENT=nocoverageredesign go test -v ./... -covermode=count -coverprofile=coverage.out | |
go tool cover -func=coverage.out -o=coverage.out | |
- name: Go Coverage Badge # Pass the `coverage.out` output to this action | |
uses: tj-actions/coverage-badge-go@84540b9f82b4f569ac9f248cf6f2893ac3cc4791 # v2 | |
with: | |
filename: coverage.out | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@6ed7632824d235029086612d4330d659005af687 # v20 | |
id: verify-changed-files | |
with: | |
files: README.md | |
- name: Commit changes | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add README.md | |
git commit -m "chore(docs): updated coverage badge." | |
- name: Push changes | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ github.token }} | |
branch: ${{ github.head_ref }} |