Skip to content

Commit

Permalink
Merge #691: Check for API changes in CI
Browse files Browse the repository at this point in the history
65d54e7 Add script to update-lock-files (Tobin C. Harding)
c61db1b CI: Check for API changes (Tobin C. Harding)
53d34d5 Update the API files (Tobin C. Harding)
c3f2c59 just: Add a command to check for API changes (Tobin C. Harding)
1e22d74 Add a justfile (Tobin C. Harding)

Pull request description:

  This PR is not just CI, it does a few clean up chores:
  - Add a `justfile` (including command to check the API)
  - Update the API files
  - Add a script to update the lock files

ACKs for top commit:
  apoelstra:
    ACK 65d54e7

Tree-SHA512: c799200dc761cb4367904346024834caf52e9a549aed5741263429d0bd297858c5293bfdb4bdf83fffb063060f7f251c9c1956659bd50867b09fafddb3c54880
  • Loading branch information
apoelstra committed Mar 27, 2024
2 parents 5fa3623 + 65d54e7 commit d5f8b2a
Show file tree
Hide file tree
Showing 8 changed files with 574 additions and 325 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,18 @@ jobs:
env:
DO_WASM: true
run: ./contrib/test.sh

API:
name: Check for changes to the public API
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-public-api
run: cargo install --locked cargo-public-api
- name: Running API checker script
run: ./contrib/check-for-api-changes.sh
184 changes: 114 additions & 70 deletions api/all-features.txt

Large diffs are not rendered by default.

167 changes: 101 additions & 66 deletions api/alloc.txt

Large diffs are not rendered by default.

167 changes: 101 additions & 66 deletions api/default-features.txt

Large diffs are not rendered by default.

168 changes: 102 additions & 66 deletions api/global-context.txt

Large diffs are not rendered by default.

149 changes: 92 additions & 57 deletions api/no-default-features.txt

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions contrib/update-lock-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# Update the minimal/recent lock file

set -euo pipefail

for file in Cargo-minimal.lock Cargo-recent.lock; do
cp --force "$file" Cargo.lock
cargo check
cp --force Cargo.lock "$file"
done
38 changes: 38 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
default:
@just --list

# Cargo build everything.
build:
cargo build --all-targets --all-features

# Cargo check everything.
check:
cargo check --all-targets --all-features

# Lint everything.
lint:
cargo clippy --all-targets --all-features -- --deny warnings

# Check the formatting
format:
cargo +nightly fmt --check

# Quick and dirty CI useful for pre-push checks.
sane: lint
cargo test --quiet --all-targets --no-default-features > /dev/null || exit 1
cargo test --quiet --all-targets > /dev/null || exit 1
cargo test --quiet --all-targets --all-features > /dev/null || exit 1

# doctests don't get run from workspace root with `cargo test`.
cargo test --quiet --doc || exit 1

# Make an attempt to catch feature gate problems in doctests
cargo test --manifest-path Cargo.toml --doc --no-default-features > /dev/null || exit 1

# Check for API changes.
check-api:
./contrib/check-for-api-changes.sh

# Update the lock files.
update-lock-files:
./contrib/update-lock-files.sh

0 comments on commit d5f8b2a

Please sign in to comment.