Skip to content

βœ… Improve GramsValueFormatter + TwelveHourFormatter coverage #55

βœ… Improve GramsValueFormatter + TwelveHourFormatter coverage

βœ… Improve GramsValueFormatter + TwelveHourFormatter coverage #55

Workflow file for this run

# This file was generated using Kotlin DSL (.github/workflows/kover.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt
name: 'Kover Coverage'
on:
push:
branches:
- 'main'
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Execute script'
run: 'rm ''.github/workflows/kover.yaml'' && ''.github/workflows/kover.main.kts'''
- id: 'step-2'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/kover.yaml'''
analyse:
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
name: 'Set up JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '17'
distribution: 'adopt'
- id: 'step-1'
uses: 'actions/checkout@v4'
- id: 'step-2'
uses: 'gradle/gradle-build-action@v3'
with:
arguments: 'koverHtmlReport'
- id: 'step-3'
run: 'cat app/build/reports/kover/html/index.html >> $GITHUB_STEP_SUMMARY'
- id: 'step-4'
uses: 'gradle/gradle-build-action@v3'
with:
arguments: 'koverXmlReport'
- id: 'step-5'
name: 'Generate coverage output'
run: |-
COVERAGE=$(${{ github.workspace }}/gradlew -q printLineCoverage)
echo "Raw Coverage: $COVERAGE"
COVERAGE=$(printf "%.0f" "$COVERAGE") # Round to integer
echo "Rounded Coverage: $COVERAGE"
echo "COVERAGE=$COVERAGE" >> $GITHUB_ENV
- id: 'step-6'
name: 'Generate Coverage Badge'
run: |-
mkdir -p badge
COLOR=$(
if [ "$COVERAGE" -ge 90 ]; then
echo "brightgreen"
elif [ "$COVERAGE" -ge 70 ]; then
echo "yellow"
else
echo "red"
fi
)
URL="https://img.shields.io/badge/Coverage-$COVERAGE%25-$COLOR"
curl -sS "$URL" -o badge/coverage-badge.svg
- id: 'step-7'
name: 'Deploy Badge to GitHub Pages'
uses: 'peaceiris/actions-gh-pages@v4'
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
publish_branch: 'gh-pages'
publish_dir: 'badge'
allow_empty_commit: 'false'
force_orphan: 'true'