Skip to content

Commit b41d3a0

Browse files
committed
chore: Update code coverage badger
1 parent 4f4d648 commit b41d3a0

4 files changed

Lines changed: 24 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ jobs:
7373
env:
7474
DATABASE_URL: postgresql://testuser@localhost:5432/backfill_test
7575

76-
- name: Generate code coverage
77-
run: |
78-
cargo llvm-cov --all-targets --workspace --lcov --output-path lcov.info
79-
# Extract coverage percentage and save it
80-
COVERAGE=$(cargo llvm-cov --all-targets --workspace --summary-only | grep -E "TOTAL.*[0-9]+\.[0-9]+%" | grep -oE "[0-9]+\.[0-9]+%" | head -1)
81-
echo "COVERAGE_PERCENTAGE=$COVERAGE" >> $GITHUB_ENV
82-
echo "Coverage: $COVERAGE"
83-
env:
84-
DATABASE_URL: postgresql://testuser@localhost:5432/backfill_test
76+
# - name: Generate code coverage
77+
# run: |
78+
# # cargo llvm-cov --all-targets -F axum --workspace --lcov --output-path lcov.info
79+
# # Extract coverage percentage and save it
80+
# COVERAGE=$(cargo llvm-cov --all-targets -F axum --workspace --summary-only | grep -E "TOTAL.*[0-9]+\.[0-9]+%" | grep -oE "[0-9]+\.[0-9]+%" | head -1)
81+
# echo "COVERAGE_PERCENTAGE=$COVERAGE" >> $GITHUB_ENV
82+
# echo "Coverage: $COVERAGE"
83+
# env:
84+
# DATABASE_URL: postgresql://testuser@localhost:5432/backfill_test

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ axum = "0.8"
3838
fastrand = "2.0"
3939
tower-http = { version = "0.6", features = ["cors", "trace"] }
4040

41+
# Examples that require specific features
42+
[[example]]
43+
name = "admin_server"
44+
required-features = ["axum"]
45+
4146
[lints.rust]
4247
unsafe_code = { level = "deny", priority = 1 }
4348
future_incompatible = { level = "deny", priority = 2 }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# backfill
22

33
[![CI](https://github.com/ceejbot/backfill/workflows/CI/badge.svg)](https://github.com/ceejbot/backfill/actions)
4-
[![Coverage](https://img.shields.io/badge/coverage-74.62%25-yellow)](https://github.com/ceejbot/backfill/actions)
4+
[![Coverage](https://img.shields.io/badge/coverage-74.63%25-yellow)](https://github.com/ceejbot/backfill/actions)
55
[![Security](https://github.com/ceejbot/backfill/actions/workflows/security.yml/badge.svg)](https://github.com/ceejbot/backfill/actions/workflows/security.yml)
66

77
A boringly-named priority queue system for doing async work. This library and work process wrap the the [graphile_worker crate](https://lib.rs/crates/graphile_worker) to do things the way I want to do them. It's unlikely you'll want to do things exactly this way, but perhaps you can learn by reading the code, or get a jumpstart by borrowing open-source code, or heck, maybe this will do what you need.

scripts/update-coverage-badge.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ fi
2929
echo "Badge color: $COLOR"
3030

3131
# Update README.md
32-
COVERAGE_ESCAPED=$(echo "$COVERAGE" | sed 's/%/%25/g')
33-
sed -i.bak "s/coverage-[0-9]*\.[0-9]*%25-[a-z]*/coverage-${COVERAGE_ESCAPED}-${COLOR}/" README.md
32+
if [[ -n $(which sd) ]]; then
33+
COVERAGE_ESCAPED=$(echo "$COVERAGE" | sd -s '%' '%25')
34+
sd "coverage-[0-9]*\.[0-9]*%25-[a-z]*" "coverage-${COVERAGE_ESCAPED}-${COLOR}" README.md
35+
else
36+
COVERAGE_ESCAPED=$(echo "$COVERAGE" | sed 's/%/%25/g')
37+
sed -i.bak "s/coverage-[0-9]*\.[0-9]*%25-[a-z]*/coverage-${COVERAGE_ESCAPED}-${COLOR}/" README.md
38+
echo "Backup saved as README.md.bak"
39+
fi
40+
3441

3542
echo "Updated coverage badge in README.md to $COVERAGE ($COLOR)"
36-
echo "Backup saved as README.md.bak"

0 commit comments

Comments
 (0)