Skip to content

Инкремент 18. Документация #12

Инкремент 18. Документация

Инкремент 18. Документация #12

Workflow file for this run

name: generate badges
on:
pull_request:
push:
jobs:
coverage_badge:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Branch Name
id: branch_name
run: |
BR=$(./scripts/safe-branch-name)
echo $BR
echo "value=$BR" >> $GITHUB_OUTPUT
- name: Generate coverage
id: coverage
run: |
go test ./... -coverprofile coverage.out
COVERAGE=`go tool cover -func=coverage.out | grep total: | grep -Eo '[0-9]+\.[0-9]+'`
echo $COVERAGE
echo "value=$COVERAGE" >> $GITHUB_OUTPUT
- name: Create Awesome Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: ${{ vars.BADGE_GIST_ID}}
filename: ${{steps.branch_name.outputs.value}}.json # Use test.svg if you want to use the SVG mode.
label: покрытие тестами
message: ${{steps.coverage.outputs.value}}%
valColorRange: ${{steps.coverage.outputs.value}}%
maxColorRange: 90
minColorRange: 50