diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 000000000..82656ac31 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -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 diff --git a/README.md b/README.md index 4d6d7adb1..9038f0c0b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![codecov](https://codecov.io/github/redis/redis/graph/badge.svg?token=6bVHb5fRuz)](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? diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..05e315dcc --- /dev/null +++ b/codecov.yml @@ -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 diff --git a/src/Makefile b/src/Makefile index 4f394782d..0eb2cf41b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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