Add codecov to ci

This commit is contained in:
ofekshenawa 2024-07-15 11:23:55 +03:00
parent f3cd444236
commit 36c86d058a
1 changed files with 42 additions and 0 deletions

42
.github/workflows/coverage.yaml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Go
on:
push:
branches:
- main
pull_request:
branches:
- main
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@v2
with:
go-version: 1.21
- name: Install dependencies
run: go mod tidy
- 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 }}