diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 67f10a6e..747bb8ef 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -38,7 +38,11 @@ jobs: --no-progress --follow-symlinks --delete --only-show-errors - name: Run firmware coverage script - run: ledger/coverage/gen-coverage + run: | + ledger/coverage/gen-coverage + COVPCT=$(cat ledger/coverage/output/total) + COVCOL=$(utils/coverage-color.sh $COVPCT) + echo "{ \"schemaVersion\": 1, \"label\": \"Firmware coverage\", \"message\": \"$COVPCT%\", \"color\": \"$COVCOL\" }" > ledger/coverage/output/badge.json - name: "Upload firmware coverage report" run: | diff --git a/README.md b/README.md index 30d585b3..f77da9ac 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ ![Tests](https://github.com/rsksmart/rsk-powhsm/actions/workflows/run-tests.yml/badge.svg) ![Python linter](https://github.com/rsksmart/rsk-powhsm/actions/workflows/lint-python.yml/badge.svg) ![C linter](https://github.com/rsksmart/rsk-powhsm/actions/workflows/lint-c.yml/badge.svg) +![Middleware coverage](https://img.shields.io/endpoint?url=https://d16sboe9lzo4ru.cloudfront.net/middleware_coverage_report/badge.json) +![Firmware coverage](https://img.shields.io/endpoint?url=https://d16sboe9lzo4ru.cloudfront.net/firmware_coverage_report/badge.json) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)