Skip to content

Commit d5f8b2a

Browse files
committed
Merge #691: Check for API changes in CI
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
2 parents 5fa3623 + 65d54e7 commit d5f8b2a

8 files changed

+574
-325
lines changed

.github/workflows/rust.yml

+15
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,18 @@ jobs:
116116
env:
117117
DO_WASM: true
118118
run: ./contrib/test.sh
119+
120+
API:
121+
name: Check for changes to the public API
122+
runs-on: ubuntu-latest
123+
strategy:
124+
fail-fast: false
125+
steps:
126+
- name: Checkout Crate
127+
uses: actions/checkout@v3
128+
- name: Checkout Toolchain
129+
uses: dtolnay/rust-toolchain@nightly
130+
- name: Install cargo-public-api
131+
run: cargo install --locked cargo-public-api
132+
- name: Running API checker script
133+
run: ./contrib/check-for-api-changes.sh

api/all-features.txt

+114-70
Large diffs are not rendered by default.

api/alloc.txt

+101-66
Large diffs are not rendered by default.

api/default-features.txt

+101-66
Large diffs are not rendered by default.

api/global-context.txt

+102-66
Large diffs are not rendered by default.

api/no-default-features.txt

+92-57
Large diffs are not rendered by default.

contrib/update-lock-files.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Update the minimal/recent lock file
4+
5+
set -euo pipefail
6+
7+
for file in Cargo-minimal.lock Cargo-recent.lock; do
8+
cp --force "$file" Cargo.lock
9+
cargo check
10+
cp --force Cargo.lock "$file"
11+
done

justfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
default:
2+
@just --list
3+
4+
# Cargo build everything.
5+
build:
6+
cargo build --all-targets --all-features
7+
8+
# Cargo check everything.
9+
check:
10+
cargo check --all-targets --all-features
11+
12+
# Lint everything.
13+
lint:
14+
cargo clippy --all-targets --all-features -- --deny warnings
15+
16+
# Check the formatting
17+
format:
18+
cargo +nightly fmt --check
19+
20+
# Quick and dirty CI useful for pre-push checks.
21+
sane: lint
22+
cargo test --quiet --all-targets --no-default-features > /dev/null || exit 1
23+
cargo test --quiet --all-targets > /dev/null || exit 1
24+
cargo test --quiet --all-targets --all-features > /dev/null || exit 1
25+
26+
# doctests don't get run from workspace root with `cargo test`.
27+
cargo test --quiet --doc || exit 1
28+
29+
# Make an attempt to catch feature gate problems in doctests
30+
cargo test --manifest-path Cargo.toml --doc --no-default-features > /dev/null || exit 1
31+
32+
# Check for API changes.
33+
check-api:
34+
./contrib/check-for-api-changes.sh
35+
36+
# Update the lock files.
37+
update-lock-files:
38+
./contrib/update-lock-files.sh

0 commit comments

Comments
 (0)