Skip to content
Merged
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
14 changes: 10 additions & 4 deletions .github/workflows/public-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ jobs:
public-api:
runs-on: ubuntu-latest
env:
# Pin the tool so its textual output format is stable across CI runs (matches
# the version used to generate the committed baselines).
# The committed baselines are only reproducible if BOTH inputs are pinned.
# cargo-public-api renders from rustdoc JSON, so the nightly that produces
# that JSON decides the output text just as much as the tool version does:
# a floating nightly rewrote `std::io::error::Error` to `core::io::error::Error`
# and reddened this gate on an API that had not changed at all.
# Bumping NIGHTLY is therefore a deliberate act that regenerates the
# baselines in the same commit -- never one without the other.
CARGO_PUBLIC_API_VERSION: "0.52.0"
NIGHTLY: "nightly-2026-05-12"
OMIT: "blanket-impls,auto-trait-impls,auto-derived-impls"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Install nightly (cargo-public-api needs rustdoc JSON)
run: rustup toolchain install nightly --profile minimal
run: rustup toolchain install "$NIGHTLY" --profile minimal
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: Install cargo-public-api
run: cargo install cargo-public-api --locked --version "$CARGO_PUBLIC_API_VERSION"
Expand All @@ -37,7 +43,7 @@ jobs:
fail=0
for crate in blob-decoder; do
echo "::group::$crate"
cargo public-api -p "$crate" --all-features --omit "$OMIT" > "/tmp/$crate.txt"
cargo "+$NIGHTLY" public-api -p "$crate" --all-features --omit "$OMIT" > "/tmp/$crate.txt"
if ! diff -u "public-api/$crate.txt" "/tmp/$crate.txt"; then
echo "::error::Public API of $crate changed. If intentional, regenerate the baseline in this PR:"
echo " cargo public-api -p $crate --all-features --omit $OMIT > public-api/$crate.txt"
Expand Down
Loading