forked from Azure/AgentBaker
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.18 KB
/
Copy pathcheck-coverage.yml
File metadata and controls
45 lines (43 loc) · 1.18 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
43
44
45
name: "Test coverage"
on:
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v6
with:
go-version: '1.25'
- name: Checkout code
uses: actions/checkout@v6
- name: Run unit tests
run: go test `go list ./... | grep -v e2e` -coverprofile coverage_raw.out -covermode count
- name: Remove mocks.go lines
run: |
sed '/mocks.go/d' coverage_raw.out > coverage-no-mocks.out
- name: Remove proto lines
run: |
sed '/pb.go/d' coverage-no-mocks.out > coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: run-1
path-to-lcov: coverage.lcov
finish:
needs: [unit_tests]
if: ${{ success() }}
runs-on: ubuntu-24.04
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "run-1"