-
Notifications
You must be signed in to change notification settings - Fork 14
51 lines (48 loc) · 1.28 KB
/
coverage.yml
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
46
47
48
49
50
51
name: coverage
on:
push:
branches:
- main
workflow_call:
inputs:
go_version:
required: false
type: string
default: '1.20.0'
permissions:
contents: write
pull-requests: write
jobs:
coverage:
strategy:
matrix:
include:
- module: "config"
- module: "healthcheck"
- module: "httpclient"
- module: "generate"
- module: "log"
- module: "trace"
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ inputs.go_version }}
- name: Download modules for ${{ matrix.module }}
working-directory: ${{ matrix.module }}
run: go mod download
- name: Run tests for ${{ matrix.module }}
working-directory: ${{ matrix.module }}
run: go test -v -race -failfast -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./...
- name: Codecov for ${{ matrix.module }}
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
flags: ${{ matrix.module }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}