-
Notifications
You must be signed in to change notification settings - Fork 23
ci: add codecov #510
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
base: main
Are you sure you want to change the base?
ci: add codecov #510
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||
| name: Coverage | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| pull_request: | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| coverage: | ||||||||||||||
| name: Run Tests and Upload Coverage | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| steps: | ||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||
|
|
||||||||||||||
| - uses: actions/setup-go@v6 | ||||||||||||||
| with: | ||||||||||||||
| go-version-file: go.mod | ||||||||||||||
|
|
||||||||||||||
| - name: Run tests with coverage | ||||||||||||||
| run: go list ./... | grep -v -e /test -e /e2e | xargs go test -race -coverprofile=coverage.out -covermode=atomic | ||||||||||||||
|
|
||||||||||||||
| - name: Upload coverage to Codecov | ||||||||||||||
| uses: codecov/codecov-action@v5 | ||||||||||||||
| with: | ||||||||||||||
| fail_ci_if_error: true | ||||||||||||||
| verbose: true | ||||||||||||||
| dry_run: true | ||||||||||||||
|
Comment on lines
+20
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Two related gaps:
🛡️ Proposed fix on:
pull_request:
+ push:
+ branches:
+ - main
...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
+ token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true🤖 Prompt for AI AgentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With 🐛 Proposed fix - name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
verbose: true
- dry_run: true📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| coverage: | ||
| status: | ||
| project: | ||
| default: | ||
| target: auto | ||
| threshold: 1% | ||
| informational: false | ||
|
|
||
| patch: | ||
| default: | ||
| target: 70% | ||
| threshold: 0% | ||
| informational: false | ||
| only_pulls: true | ||
|
|
||
| ignore: | ||
| - "**/e2e/**" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xargswithout-rwill rungo testagainst the current directory if all packages are filtered.If
grep -v -e /test -e /e2eproduces empty output (e.g., in a repo where all packages match the excluded paths),xargs go test ...receives no stdin and runsgo test -race -coverprofile=coverage.out -covermode=atomicwith no arguments — testing only the root package instead of failing clearly.🔧 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents