Skip to content

Commit 78d3a6e

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

4 files changed

Lines changed: 70 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

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: 1% # 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)