From 344839975545f16db379030877f11c51df2221f0 Mon Sep 17 00:00:00 2001 From: Fabien Danieau Date: Thu, 8 Aug 2024 17:31:13 +0200 Subject: [PATCH] enhancement #46: create badge --- .github/workflows/unit_tests.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 8593b20..175a142 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -60,3 +60,15 @@ jobs: export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") echo "total=$TOTAL" >> $GITHUB_ENV echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY + - name: Make badge + uses: schneegans/dynamic-badges-action@v1.7.0 + with: + # GIST_TOKEN is a GitHub personal access token with scope "gist". + auth: ${{ secrets.GIST_TOKEN }} + gistID: 17eb617c2e60c2dc189478dd3be6e323 # replace with your real Gist id. + filename: covbadge.json + label: Coverage + message: ${{ env.total }}% + minColorRange: 50 + maxColorRange: 90 + valColorRange: ${{ env.total }} \ No newline at end of file