Skip to content

Commit 5e27de9

Browse files
committed
chore(ci): remove dev branch jobs and add static.sh
Remove bench-dev and test-dev jobs from daily workflow since the dev branch no longer exists. Add ci/static.sh script to generate coverage badge for GitHub Pages. Refs #539
1 parent 8bf6dd2 commit 5e27de9

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

.github/workflows/daily.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,3 @@ jobs:
3434
with:
3535
name: coverage.html
3636
path: ./ci/out/coverage.html
37-
bench-dev:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@v4
41-
with:
42-
ref: dev
43-
- uses: actions/setup-go@v5
44-
with:
45-
go-version-file: ./go.mod
46-
- run: AUTOBAHN=1 make bench
47-
test-dev:
48-
runs-on: ubuntu-latest
49-
steps:
50-
- name: Disable AppArmor
51-
if: runner.os == 'Linux'
52-
run: |
53-
# Disable AppArmor for Ubuntu 23.10+.
54-
# https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
55-
echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
56-
- uses: actions/checkout@v4
57-
with:
58-
ref: dev
59-
- uses: actions/setup-go@v5
60-
with:
61-
go-version-file: ./go.mod
62-
- run: AUTOBAHN=1 make test
63-
- uses: actions/upload-artifact@v4
64-
with:
65-
name: coverage-dev.html
66-
path: ./ci/out/coverage.html

ci/static.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
cd -- "$(dirname "$0")/.."
5+
6+
if [[ ! -f ./ci/out/profile.txt ]]; then
7+
echo "No coverage profile found, run 'make test' first"
8+
exit 1
9+
fi
10+
11+
if [[ ! -f ./ci/out/coverage.html ]]; then
12+
echo "No coverage report found, run 'make test' first"
13+
exit 1
14+
fi
15+
16+
rm -rf ./ci/out/static
17+
mkdir -p ./ci/out/static
18+
cp ./ci/out/coverage.html ./ci/out/static/coverage.html
19+
percent=$(go tool cover -func ./ci/out/profile.txt | tail -n1 | awk '{print $3}' | tr -d '%')
20+
wget -O ./ci/out/static/coverage.svg "https://img.shields.io/badge/coverage-${percent}%25-success"

0 commit comments

Comments
 (0)