.github/workflows/testcov.yml
name: Test coverage
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
redis:
image: redis:7.0.5-alpine
ports:
- 6379/tcp
steps:
- name: check out code
uses: actions/checkout@v3
- name: set up golang
uses: actions/setup-go@v5
with:
go-version: '~1.20.6'
- name: unit test
run: go test -covermode=atomic -coverprofile=profile.cov -v ./...
env:
REDIS_MASTER_SERVICE_HOST: localhost
REDIS_MASTER_SERVICE_PORT: ${{ job.services.redis.ports[6379] }}
GOPROXY: https://proxy.golang.org
- name: upload coverage to codecov
uses: codecov/codecov-action@v4
with:
file: ./profile.cov