Skip to content

Commit 81ec23a

Browse files
ElusAegisclaude
andauthored
fix: repair the broken README badges (#46)
This PR resolves the broken or misleading badges in the template README. **Coverage (dropped):** The badge pointed at `coverage.yml`, a workflow that did not exist (the real one was `coverage-pr.yml`), so it rendered as a broken image. Pointing it at the correct `coverage-pr.yml` would have rendered correctly, however it would have been misleading, as it would only indicate whether the CI run succeeded (already shown by the CI flag) and not the coverage percentage (or whether it had regressed, given how the CI is structured). After considering how to show the percentage, either through persisting it in the Pages deploy or on a dedicated badges branch, both seemed awkward enough not to enforce as a default, and hence the removal of the badge. **Docs:** Docs in the repo can be published two ways (GitHub Pages via `docs.yml`, or docs.rs on a crates.io publish). Offering both badges caused issues, as they are effectively mutually exclusive: there should be only one canonical place for the docs, not two competing links. Pages is the default doc mode the template configures (with `docs.yml` running on push to main); if you publish to crates.io instead, delete `docs.yml` and swap in the docs.rs badge, kept as a commented snippet beside it. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 888640c commit 81ec23a

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/docs.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
name: Docs
22

3-
# TODO(template)
4-
# GH pages seems to work properly for public repos
53
on:
4+
# Publishes rustdoc to GitHub Pages on every push to main.
5+
# TODO(template) This REQUIRES GitHub Pages enabled (Settings -> Pages -> Source:
6+
# GitHub Actions); until you enable it these runs will fail. If you publish the crate
7+
# to crates.io instead, delete this workflow and use the docs.rs badge in the README.
8+
push:
9+
branches: [main]
610
workflow_dispatch:
711

812
permissions:

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# :crab: RUST PROJECT TEMPLATE - TODO(template) PUT PROJECT NAME HERE
22
<!--`TODO(template) update each badge with your username and repository name.`-->
3-
[![Docs](https://github.com/NethermindEth/rust-template/actions/workflows/docs.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/docs.yml)
43
[![Lint](https://github.com/NethermindEth/rust-template/actions/workflows/linter.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/linter.yml)
54
[![Build](https://github.com/NethermindEth/rust-template/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/build-and-test.yml)
65
[![Dependencies](https://github.com/NethermindEth/rust-template/actions/workflows/dependency-audit.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/dependency-audit.yml)
76
[![UB](https://github.com/NethermindEth/rust-template/actions/workflows/ub-detection.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/ub-detection.yml)
8-
[![Coverage](https://github.com/NethermindEth/rust-template/actions/workflows/coverage.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/coverage.yml)
7+
[![Docs](https://github.com/NethermindEth/rust-template/actions/workflows/docs.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/docs.yml)
8+
<!-- `TODO(template)` The Docs badge above tracks the GitHub Pages docs deploy (docs.yml) --
9+
the default docs path for this template. It only turns GREEN once you enable GitHub
10+
Pages (Settings -> Pages -> Source: GitHub Actions); until then docs.yml fails on push
11+
and the badge is red. If instead you publish the crate to crates.io, docs.rs builds
12+
your docs on publish -- delete docs.yml and swap the Docs badge above for this one:
13+
[![Docs](https://docs.rs/your-crate-name/badge.svg)](https://docs.rs/your-crate-name)
14+
-->
915
<!-- You can replace them with a single badge if you create a main CI file that calls the other workflows
1016
[![CI](https://github.com/{{USERNAME}}/{{REPOSITORY}}/workflows/CI/badge.svg)](https://github.com/{{USERNAME}}/{{REPOSITORY}}/actions)
1117
-->
@@ -16,9 +22,9 @@ If you want to change from stable to Minimum Supported Rust Version (MSRV), repl
1622
![Rust](https://img.shields.io/badge/rust-stable-orange.svg)
1723
<!--`TODO(template) update license version if needed. Check LICENSE first`-->
1824
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
19-
<!--`TODO(template) update with your crate information. Remove if not needed.`-->
20-
[![Crates.io](https://img.shields.io/crates/v/{{CRATE_NAME}}.svg)](https://crates.io/crates/{{CRATE_NAME}})
21-
[![Documentation](https://docs.rs/{{CRATE_NAME}}/badge.svg)](https://docs.rs/{{CRATE_NAME}})
25+
<!--`TODO(template)` set your-crate-name below; shows "crates.io | not found" until you
26+
publish to crates.io. Remove this badge if you don't publish.-->
27+
[![Crates.io](https://img.shields.io/crates/v/your-crate-name.svg)](https://crates.io/crates/your-crate-name)
2228

2329
TODO(template) describe the project
2430

@@ -33,7 +39,7 @@ This is a rust template from ZKE team :rocket: (a focus on cryptographic libs in
3339
- [ ] Settings -> Pages -> Build and deployment -> Source Github Actions
3440
- [ ] Update the description of the repo at the repo's page, add tag topics
3541
- [ ] Introduce necessary sections at the repo's page (releases, deployments etc)
36-
- [ ] Add a website url (if applicable) or a docs page (see [docs](./.github/workflows/docs.yml) flow for public repos)
42+
- [ ] Docs: this template publishes rustdoc to GitHub Pages on push to main ([`docs.yml`](./.github/workflows/docs.yml)). Enable Pages (Settings -> Pages -> Source: GitHub Actions) so the deploy succeeds and the Docs badge turns green, and set the Pages URL as the repo website (About -> Website). If you publish to crates.io instead, delete `docs.yml` and use the docs.rs badge in the README
3743
- [ ] Add [all contributors](https://allcontributors.org/docs/en/cli/installation)
3844
- [ ] Import protection rulesets (see below) in the repo settings (Settings -> Rules -> Rulesets -> Import a ruleset)
3945
- [ ] For binary crates with specific requirements to Rust features consider also [pinning](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) the rust toolchain version

0 commit comments

Comments
 (0)