Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
37 changes: 37 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
codecov:
notify:
after_n_builds: 1
require_ci_to_pass: false

coverage:
precision: 2
round: down
range: 50..75

status:
project:
default:
enabled: true
# Report coverage; do not fail PRs on small drops until we set a target.
threshold: null
if_not_found: success
if_no_uploads: success
if_ci_failed: error
patch:
default:
enabled: true
threshold: null
if_not_found: success
if_no_uploads: success
if_ci_failed: error
changes: false

comment:
layout: "header, diff"
behavior: default
require_changes: false

ignore:
- "**/zz_generated.*.go"
- "**/applyconfiguration/**"
38 changes: 38 additions & 0 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Codecov

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
codecov:
name: Upload coverage
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod

- name: Run unit tests with coverage
run: |
go mod tidy
make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Comment thread
ibm-adarsh marked this conversation as resolved.
Outdated
with:
files: ./cover.out
fail_ci_if_error: true
1 change: 1 addition & 0 deletions site-src/contributing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ From the repository root:
- **Lint / vet:** `make lint`
- **Tests:** `make test` (writes `cover.out` for coverage)
- **Test coverage:** `make test` writes `cover.out`. Run `make test-cover` to refresh tests and emit `out/coverage.html` and `out/coverage.txt` (`go tool cover`). With `cover.out` present, `make cover-func` prints a per-function summary and `make cover-html` opens the interactive HTML report in a browser (local). Remove generated artifacts with `make cover-clean`.
- **CI coverage:** Pull requests and pushes to `main` upload `cover.out` to [Codecov](https://codecov.io/gh/kubernetes-sigs/mcp-lifecycle-operator).
- **Generate manifests:** `make manifests generate`

After making changes, open a pull request on GitHub. Ensure CI passes and address any review feedback.
Expand Down
Loading