Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions .github/workflows/badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
xauth

- name: Generate coverage
run: xvfb-run -a ./scripts/coverage.sh | tee coverage-report.txt
run: |
set -o pipefail
xvfb-run -a ./scripts/coverage.sh | tee coverage-report.txt

- name: Generate coverage badge
run: |
Expand All @@ -45,23 +47,31 @@ jobs:
echo "coverage total not found" >&2
exit 1
fi
color="red"
state_top="#E05D44"
state_bottom="#CB2431"
if awk "BEGIN {exit !($total >= 80)}"; then
color="green"
state_top="#34D058"
state_bottom="#28A745"
elif awk "BEGIN {exit !($total >= 60)}"; then
color="yellow"
state_top="#DBAB09"
state_bottom="#B08800"
fi
mkdir -p public/badges
cat > public/badges/coverage.svg <<EOF
<svg xmlns="http://www.w3.org/2000/svg" width="130" height="20" role="img" aria-label="coverage: ${total}%">
<linearGradient id="s" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<rect rx="3" width="130" height="20" fill="#555"/>
<rect rx="3" x="62" width="68" height="20" fill="${color}"/>
<path fill="${color}" d="M62 0h4v20h-4z"/>
<rect rx="3" width="130" height="20" fill="url(#s)"/>
<defs>
<linearGradient id="workflow-fill" x1="50%" y1="0%" x2="50%" y2="100%">
<stop stop-color="#444D56" offset="0%"/>
<stop stop-color="#24292E" offset="100%"/>
</linearGradient>
<linearGradient id="state-fill" x1="50%" y1="0%" x2="50%" y2="100%">
<stop stop-color="${state_top}" offset="0%"/>
<stop stop-color="${state_bottom}" offset="100%"/>
</linearGradient>
</defs>
<rect rx="3" width="130" height="20" fill="url(#workflow-fill)"/>
<rect rx="3" x="62" width="68" height="20" fill="url(#state-fill)"/>
<path fill="url(#state-fill)" d="M62 0h4v20h-4z"/>
<g fill="#fff" text-anchor="middle" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
<text x="31" y="14">coverage</text>
<text x="96" y="14">${total}%</text>
Expand Down
4 changes: 4 additions & 0 deletions cmd/voiced/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func newVoiceDaemon(serverURL, token, pttBind, pttBackend string, iceConfig webr
}

func (d *voiceDaemon) Run(ctx context.Context, ipcAddr string) error {
if ctx.Err() != nil {
return nil
}

d.sts = newVoiceStats()
go d.sts.LogLoop(ctx)
d.startPlayback(ctx)
Expand Down
Loading