mirror of
https://github.com/redis/redis.git
synced 2025-12-18 21:46:08 -05:00
Add codecov for automated code coverage (#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 <debing.sun@redis.com>
This commit is contained in:
parent
eb50eb20a5
commit
5dbcb3e4ab
4 changed files with 47 additions and 1 deletions
24
.github/workflows/codecov.yml
vendored
Normal file
24
.github/workflows/codecov.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
name: "Codecov"
|
||||
|
||||
# Enabling on each push is to display the coverage changes in every PR,
|
||||
# where each PR needs to be compared against the coverage of the head commit
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
code-coverage:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install lcov and run test
|
||||
run: |
|
||||
sudo apt-get install lcov
|
||||
make lcov
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./src/redis.info
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
[](https://codecov.io/github/redis/redis)
|
||||
|
||||
This README is just a fast *quick start* document. You can find more detailed documentation at [redis.io](https://redis.io).
|
||||
|
||||
What is Redis?
|
||||
|
|
|
|||
19
codecov.yml
Normal file
19
codecov.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
coverage:
|
||||
status:
|
||||
patch:
|
||||
default:
|
||||
informational: true
|
||||
project:
|
||||
default:
|
||||
informational: true
|
||||
|
||||
comment:
|
||||
require_changes: false
|
||||
require_head: false
|
||||
require_base: false
|
||||
layout: "condensed_header, diff, files"
|
||||
hide_project_coverage: false
|
||||
behavior: default
|
||||
|
||||
github_checks:
|
||||
annotations: false
|
||||
|
|
@ -487,8 +487,9 @@ test-cluster: $(REDIS_SERVER_NAME) $(REDIS_CLI_NAME)
|
|||
check: test
|
||||
|
||||
lcov:
|
||||
@lcov --version
|
||||
$(MAKE) gcov
|
||||
@(set -e; cd ..; ./runtest --clients 1)
|
||||
@(set -e; cd ..; ./runtest)
|
||||
@geninfo -o redis.info .
|
||||
@genhtml --legend -o lcov-html redis.info
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue