-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.11 KB
/
ci.yml
File metadata and controls
42 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Go CI
on:
push:
branches:
- develop
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4 # Update to the latest version to support Node 20
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.8 # Updated to the specified Go version
- name: Install dependencies
run: go mod download
- name: Run tests with coverage
run: |
# Run tests and generate a coverage profile
go test -v -coverprofile=coverage.txt ./...
# Filter out the "tests" directory from the coverage profile
grep -v -E "(/tests/|/mocks/)" coverage.txt > coverage_filtered.txt
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage_filtered.txt # Use the filtered coverage file
token: ${{ secrets.CODECOV_TOKEN }} # Add your Codecov token in GitHub Secrets
flags: unittests
name: codecov-coverage
fail_ci_if_error: true