Skip to content

Commit b97400a

Browse files
committed
ci: add support for codecov components and add dedicated workflow
1 parent 53a5244 commit b97400a

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
File renamed without changes.

.github/workflows/coverage.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Code Coverage
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
push:
7+
branches:
8+
- main
9+
- master
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
coverage:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v5
20+
with:
21+
fetch-depth: 1
22+
23+
- name: Install Go
24+
uses: actions/setup-go@v6
25+
with:
26+
go-version: stable
27+
28+
- name: Install Terraform
29+
uses: hashicorp/setup-terraform@v3
30+
31+
- name: Build binaries
32+
run: make build
33+
34+
- name: Verify go.mod is tidy
35+
run: |
36+
go mod tidy
37+
git diff --exit-code
38+
39+
- name: Run coverage
40+
run: go tool gotestsum --format github-actions --junitfile junit.xml -- -coverprofile=coverage.out -covermode=count ./...
41+
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v5
44+
45+
- name: Upload test results to Codecov
46+
if: ${{ !cancelled() }}
47+
uses: codecov/test-results-action@v1
48+
with:
49+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)