-
Notifications
You must be signed in to change notification settings - Fork 101
ci: add codecov configuration #2069
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
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,31 @@ | ||
| codecov: | ||
| require_ci_to_pass: true | ||
|
|
||
| coverage: | ||
| precision: 2 | ||
| round: down | ||
| range: "60...80" | ||
| status: | ||
| project: | ||
| default: | ||
| target: auto | ||
| threshold: 1% | ||
| patch: | ||
| default: | ||
| target: 80% | ||
| threshold: 5% | ||
|
|
||
| ignore: | ||
| - "**/*_test.go" | ||
| - "**/testdata/**" | ||
| - "docs/**" | ||
| - "hack/**" | ||
| - "experiments/**" | ||
| - "images/**" | ||
| - "**/*.md" | ||
| - "**/*.sh" | ||
|
|
||
| comment: | ||
| layout: "reach,diff,flags,files,footer" | ||
| behavior: default | ||
| require_changes: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,20 @@ jobs: | |
| echo "1f4e0ef7f6554a6ed33dd7ac144fb2e1bbed98598e7af973042fc5cd43951c9a /tmp/lychee.tar.gz" | sha256sum -c | ||
| tar xzf /tmp/lychee.tar.gz -C /usr/local/bin --strip-components=1 lychee-x86_64-unknown-linux-gnu/lychee | ||
|
|
||
| - run: make test | ||
| - run: make lint-all | ||
|
|
||
| - name: Run Go tests with coverage | ||
| run: go test -race -coverprofile=coverage.out ./... | ||
| env: | ||
| GH_TOKEN: "" | ||
| GITHUB_TOKEN: "" | ||
|
|
||
| - run: make script-test | ||
|
|
||
| - name: Upload coverage to Codecov | ||
|
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. [low] supply-chain The codecov/codecov-action is referenced by mutable major-version tag (@v5) rather than a full commit SHA. This follows the existing convention in the workflow, but SHA pinning is best practice. Risk is mitigated by read-only permissions. |
||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
|
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. [low] supply-chain The codecov/codecov-action is referenced by mutable major-version tag (@v5) rather than a full commit SHA. Follows existing repo convention but SHA pinning is best practice. Risk mitigated by read-only permissions. Suggested fix: Pin the action to a specific commit SHA and use Dependabot or Renovate to keep the pin up to date. |
||
| files: coverage.out | ||
|
|
||
| commit-lint: | ||
| # On pull_request: lint the PR title (which becomes the merge commit | ||
|
|
||
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.
[low] redundant-execution
Go tests are executed twice in the same job: first via make test (go test -race -cover) then again via go test -race -coverprofile=coverage.out. This doubles Go test execution time.
Suggested fix: Modify the Makefile go-test target to accept a COVERPROFILE variable, or remove the make test step since the coverage step runs the same tests.