Skip to content

Commit 0e7b987

Browse files
committed
Measure repository size from fresh clone
1 parent 0e22836 commit 0e7b987

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/pages.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,28 @@ jobs:
2626
run: |
2727
set -euo pipefail
2828
mkdir -p site/auxiliary
29+
mkdir -p site/metrics
2930
curl -L --fail \
3031
-o site/auxiliary/nabla-glow.svg \
3132
https://github.com/Devsh-Graphics-Programming/Nabla-Asset-Manifests/releases/download/pages-assets/nabla-glow.svg
3233
curl -L --fail \
3334
-o site/auxiliary/externaldata-flow-kitware.jpg \
3435
https://github.com/Devsh-Graphics-Programming/Nabla-Asset-Manifests/releases/download/pages-assets/externaldata-flow-kitware.jpg
36+
git clone --quiet https://github.com/Devsh-Graphics-Programming/Nabla-Asset-Manifests.git repo-size-check
37+
python - <<'PY'
38+
import json
39+
from pathlib import Path
40+
pack_dir = Path("repo-size-check/.git/objects/pack")
41+
total = sum(path.stat().st_size for path in pack_dir.glob("*"))
42+
kib = (total + 1023) // 1024
43+
payload = {
44+
"schemaVersion": 1,
45+
"label": "repo size",
46+
"message": f"{kib} KiB",
47+
"color": "blue",
48+
}
49+
Path("site/metrics/repo-size.json").write_text(json.dumps(payload), encoding="utf-8")
50+
PY
3551
printf '%s\n' '<!doctype html><meta charset="utf-8"><title>Nabla Asset Manifests Pages</title>' > site/index.html
3652
touch site/.nojekyll
3753

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a href="https://github.com/Devsh-Graphics-Programming/Nabla-Asset-Manifests/actions/workflows/smoke.yml">
77
<img src="https://github.com/Devsh-Graphics-Programming/Nabla-Asset-Manifests/actions/workflows/smoke.yml/badge.svg" alt="Smoke Status" /></a>
88
<a href="https://github.com/Devsh-Graphics-Programming/Nabla-Asset-Manifests">
9-
<img src="https://img.shields.io/github/repo-size/Devsh-Graphics-Programming/Nabla-Asset-Manifests?label=repo%20size" alt="Repository size" /></a>
9+
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fdevsh-graphics-programming.github.io%2FNabla-Asset-Manifests%2Fmetrics%2Frepo-size.json" alt="Repository size" /></a>
1010
<a href="https://opensource.org/licenses/Apache-2.0">
1111
<img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License: Apache 2.0" /></a>
1212
<a href="https://discord.gg/krsBcABm7u">

0 commit comments

Comments
 (0)