Skip to content

Commit 4c99b92

Browse files
authored
πŸš€ ci: publish coverage badge and docs badge (#18)
* πŸš€ ci: publish coverage badge and docs badge * πŸš€ ci: publish coverage badge and docs badge * πŸ“ docs: add commit signing badge to README * πŸ› ci: fix Python here-document syntax in coverage extraction - Replace here-document with python3 -c for better shell compatibility - Fix 'unexpected EOF' and 'delimiter not found' errors in GitHub Actions - Maintain same functionality with more reliable syntax * πŸ”„ ci: switch from coverage to test success rate badge - Replace coverage-based badge with test success rate calculation - Use passed/total test ratio for more reliable metrics - Update README badge label from 'Coverage' to 'Tests' - Maintain same gist file and color thresholds (95%+ green, 80%+ yellow, <80% red)
1 parent 5b08ad6 commit 4c99b92

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

β€Ž.github/workflows/unity-editmode.ymlβ€Ž

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
22
name: Unity EditMode Suite
33

44
on:
@@ -123,6 +123,31 @@ jobs:
123123
}
124124
id: summary
125125

126+
- name: Calculate test success rate
127+
if: always()
128+
run: |
129+
if [ -n "${{ steps.summary.outputs.total }}" ] && [ "${{ steps.summary.outputs.total }}" != "0" ]; then
130+
total=${{ steps.summary.outputs.total }}
131+
passed=${{ steps.summary.outputs.passed }}
132+
success_rate=$((passed * 100 / total))
133+
echo "SUCCESS_RATE=$success_rate" >> $GITHUB_ENV
134+
echo "Test success rate: $success_rate% ($passed/$total)"
135+
else
136+
echo "SUCCESS_RATE=0" >> $GITHUB_ENV
137+
echo "No test results available"
138+
fi
139+
140+
- name: Upload test success badge
141+
if: always()
142+
uses: schneegans/dynamic-badges-action@v1.7.0
143+
with:
144+
auth: ${{ secrets.BADGE_GIST_TOKEN }}
145+
gistID: 21437d3f33ae019a0b58a88a2bf90c56
146+
filename: sorting-algo-core-coverage.json
147+
label: Tests
148+
message: "${{ env.SUCCESS_RATE }}%"
149+
color: ${{ (env.SUCCESS_RATE >= 95 && 'brightgreen') || (env.SUCCESS_RATE >= 80 && 'yellow') || 'red' }}
150+
126151
- name: Post PR Comment
127152
if: ${{ github.event_name == 'pull_request' && steps.summary.outputs.total != '' && github.event.pull_request.head.repo.full_name == github.repository }}
128153
uses: actions/github-script@v7

β€ŽREADME.mdβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Soobak Algorithm Core & Sorting
2+
[![Unity EditMode Suite](https://github.com/soo-bak/soobak-algo-core/actions/workflows/unity-editmode.yml/badge.svg)](https://github.com/soo-bak/soobak-algo-core/actions/workflows/unity-editmode.yml)
3+
[![Tests](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/soo-bak/21437d3f33ae019a0b58a88a2bf90c56/raw/sorting-algo-core-coverage.json)](https://gist.github.com/soo-bak/21437d3f33ae019a0b58a88a2bf90c56)
4+
[![Commit Signing](https://img.shields.io/badge/commits%20signed-verified-brightgreen)](https://github.com/soo-bak/soobak-algo-core/commits)
5+
26

37
Reusable Unity 6 algorithm pipeline. `com.soobak.algo.core` defines execution primitives, while `com.soobak.algo.sorting` ships a sorting domain showcase.
48

0 commit comments

Comments
Β (0)