Skip to content

Commit aaeb2c6

Browse files
ci: ast-43499 add codecov scan workflow (#262)
adding codecov scan workflow to the repo. it will trigger on PR and after merge to master. it is NOT a blocker - even if it's fail.
1 parent 184e893 commit aaeb2c6

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/codecov.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
name: Codecov Scan
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
run:
13+
runs-on: ubuntu-latest
14+
env:
15+
go-version: 'stable'
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
23+
with:
24+
go-version: ${{ env.go-version }}
25+
env:
26+
GOPROXY: direct
27+
GONOSUMDB: "*"
28+
GOPRIVATE: https://github.com/CheckmarxDev/ # Add your private organization url here
29+
30+
- name: Install dependencies
31+
run: go install golang.org/x/tools/cmd/cover@latest
32+
33+
- name: Run tests and generate coverage
34+
run: |
35+
go test ./... -coverpkg=./... -v -coverprofile cover.out
36+
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
files: ./cover.out
43+
flags: target=auto
44+
fail_ci_if_error: true
45+
verbose: false

0 commit comments

Comments
 (0)