-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1.02 KB
/
testcov.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
name: Test coverage
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:9.6.6-alpine
env:
POSTGRES_DB: pgtest
POSTGRES_USER: pguser
POSTGRES_PASSWORD: pgdocker
ports:
- 5432/tcp
steps:
- name: set up golang
uses: actions/setup-go@v4
with:
go-version: '~1.20.6'
- name: check out code
uses: actions/checkout@v3
- name: unit test
run: go test -covermode=atomic -coverprofile=profile.cov -v ./...
env:
POSTGRES_DB: pgtest
POSTGRES_USER: pguser
POSTGRES_PASSWORD: pgdocker
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
NATS_HOST: localhost
NATS_PORT: ${{ job.services.nats.ports[4222] }}
GOPROXY: https://proxy.golang.org
- name: upload coverage to codecov
uses: codecov/codecov-action@v3
with:
file: ./profile.cov