Skip to content

Commit 697ee54

Browse files
committed
chore: add codecov configuration for coverage reporting
1 parent 801cda1 commit 697ee54

6 files changed

Lines changed: 84 additions & 1 deletion

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
pull_request:
8+
9+
10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
14+
jobs:
15+
golangci:
16+
name: lint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-go@v5
21+
with:
22+
go-version: stable
23+
- name: golangci-lint
24+
uses: golangci/golangci-lint-action@v8
25+
with:
26+
version: v2.1
27+
only-new-issues: true

.github/workflows/module_controller_unit_test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
run: make test
3838

3939
- name: Upload coverage reports to Codecov
40-
uses: codecov/codecov-action@v4.0.1
40+
uses: codecov/codecov-action@v5
4141
with:
4242
token: ${{ secrets.CODECOV_TOKEN }}
43+
fail_ci_if_error: true
4344
slug: koupleless/module-controller

.golangci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: "2"
2+
3+
linters:
4+
default: standard
5+
enable:
6+
- cyclop
7+
- gocritic
8+
- gosec
9+
- ineffassign
10+
- misspell
11+
- prealloc
12+
- unconvert
13+
- unparam
14+
- whitespace
15+
16+
formatters:
17+
enable:
18+
- gofumpt
19+
- goimports

README-zh_CN.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<div align="center">
2+
3+
[English](./README.md) | 简体中文
4+
5+
</div>
6+
7+
# Module Controller
8+
9+
[![codecov](https://codecov.io/github/koupleless/module-controller/graph/badge.svg?token=L1SvoSDQsw)](https://codecov.io/github/koupleless/module-controller)
10+
111
低成本地让开源用户接入模块运维体系。
212

313
# 架构设计

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ English | [简体中文](./README-zh_CN.md)
44

55
</div>
66

7+
# Module Controller
8+
9+
[![codecov](https://codecov.io/github/koupleless/module-controller/graph/badge.svg?token=L1SvoSDQsw)](https://codecov.io/github/koupleless/module-controller)
10+
711
ModuleController is Koupleless operation and scheduling system. It is a kubernetes operator application which can be deployed to your kubernetes cluster.
812

913
For ModuleController user documentation, please see [here](https://koupleless.io/docs/tutorials/module-operation/module-online-and-offline/).

codecov.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
comment:
2+
layout: "reach, diff, flags, files"
3+
behavior: new # Only consider new coverage, not historical
4+
require_changes: false # Do not require code changes for coverage checks
5+
require_base: false # Do not require base branch coverage
6+
require_head: true # Require head branch coverage
7+
8+
coverage:
9+
ignore:
10+
- 'vendor/**'
11+
- '**/*_generated.go'
12+
- '**/zz_generated.*'
13+
- '**/mock_*.go'
14+
status:
15+
project:
16+
default:
17+
target: auto # Automatically determine target coverage based on project history
18+
threshold: 2% # Allowed fluctuation range
19+
patch:
20+
default:
21+
target: 80% # New/changed lines coverage target
22+
threshold: 1% # Allowed fluctuation range

0 commit comments

Comments
 (0)