Skip to content

Add test coverage reporting and Codecov badge #3

Add test coverage reporting and Codecov badge

Add test coverage reporting and Codecov badge #3

Workflow file for this run

name: Go
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
services:
redis:
image: redis/redis-stack-server:edge
options: >-
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test -coverprofile=coverage.out ./...
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}