Skip to content

Commit bcfff6f

Browse files
committed
ci: add GitHub Actions workflow and codecov configuration
- Add check.yaml workflow for Go tests and vet - Add .codecov.yml with coverage thresholds and PR comment settings
1 parent e2a26df commit bcfff6f

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

.codecov.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
codecov:
2+
require_ci_to_pass: true
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "40...100"
8+
status:
9+
project:
10+
default:
11+
target: auto
12+
threshold: 1%
13+
informational: false
14+
patch:
15+
default:
16+
target: auto
17+
threshold: 1%
18+
informational: false
19+
20+
comment:
21+
layout: "reach,diff,flags,tree"
22+
behavior: default
23+
require_changes: false
24+
require_base: false
25+
require_head: true
26+
27+
ignore:
28+
- "**/*_test.go"
29+
- "**/examples/**"
30+
- "**/testdata/**"

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
- package-ecosystem: gomod
8+
directory: /
9+
schedule:
10+
interval: weekly

.github/workflows/check.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v6
15+
with:
16+
fetch-depth: 1
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v6
20+
with:
21+
go-version: stable
22+
cache-dependency-path: go.sum
23+
24+
- name: Run tests
25+
run: GORACE=atexit_sleep_ms=0 go test -trimpath -failfast -race -cover -v -coverprofile=coverage.txt ./...
26+
27+
- name: Upload coverage reports to Codecov
28+
uses: codecov/codecov-action@v6
29+
with:
30+
token: ${{ secrets.CODECOV_TOKEN }}
31+
32+
- name: Run vet
33+
run: go vet ./...

0 commit comments

Comments
 (0)