Skip to content

Commit bcbfeca

Browse files
vitahlinsundb
andauthored
Add codecov for automated code coverage (redis#13393)
This PR introduces Codecov to automate code coverage tracking for our project's tests. For more information about the Codecov platform, please refer to https://docs.codecov.com/docs/quick-start --------- Co-authored-by: debing.sun <[email protected]>
1 parent 6922e00 commit bcbfeca

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

.github/workflows/codecov.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Codecov"
2+
3+
# Enabling on each push is to display the coverage changes in every PR,
4+
# where each PR needs to be compared against the coverage of the head commit
5+
on: [push, pull_request]
6+
7+
jobs:
8+
code-coverage:
9+
runs-on: ubuntu-22.04
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Install lcov and run test
16+
run: |
17+
sudo apt-get install lcov
18+
make lcov
19+
20+
- name: Upload coverage reports to Codecov
21+
uses: codecov/codecov-action@v4
22+
with:
23+
token: ${{ secrets.CODECOV_TOKEN }}
24+
file: ./src/redis.info

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![codecov](https://codecov.io/github/redis/redis/graph/badge.svg?token=6bVHb5fRuz)](https://codecov.io/github/redis/redis)
2+
13
This README is just a fast *quick start* document. You can find more detailed documentation at [redis.io](https://redis.io).
24

35
What is Redis?

codecov.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
coverage:
2+
status:
3+
patch:
4+
default:
5+
informational: true
6+
project:
7+
default:
8+
informational: true
9+
10+
comment:
11+
require_changes: false
12+
require_head: false
13+
require_base: false
14+
layout: "condensed_header, diff, files"
15+
hide_project_coverage: false
16+
behavior: default
17+
18+
github_checks:
19+
annotations: false

src/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,9 @@ test-cluster: $(REDIS_SERVER_NAME) $(REDIS_CLI_NAME)
487487
check: test
488488

489489
lcov:
490+
@lcov --version
490491
$(MAKE) gcov
491-
@(set -e; cd ..; ./runtest --clients 1)
492+
@(set -e; cd ..; ./runtest)
492493
@geninfo -o redis.info .
493494
@genhtml --legend -o lcov-html redis.info
494495

0 commit comments

Comments
 (0)