Skip to content

Commit 32d3188

Browse files
authored
Merge pull request rust-bitcoin#142 from nyonson/drop-workspace-flag
Drop unnecessary cargo flags
2 parents b6f02c5 + de89c40 commit 32d3188

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ on:
99
- main
1010

1111
jobs:
12-
# Quick canary of code as well as potential issues with upcoming toolchains.
1312
check:
1413
runs-on: ubuntu-latest
1514
steps:
1615
- uses: actions/checkout@v4
1716
- uses: extractions/setup-just@v3
1817
- uses: actions-rust-lang/setup-rust-toolchain@v1
1918
- run: just check
20-
# Build and test the code across platforms.
21-
test:
19+
features:
2220
strategy:
2321
matrix:
2422
platform: [ubuntu-latest, macos-latest, windows-latest]
@@ -27,7 +25,7 @@ jobs:
2725
- uses: actions/checkout@v4
2826
- uses: extractions/setup-just@v3
2927
- uses: actions-rust-lang/setup-rust-toolchain@v1
30-
- run: just test
28+
- run: just test features
3129
msrv:
3230
runs-on: ubuntu-latest
3331
steps:

justfile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# The recipes make heavy use of `rustup`'s toolchain syntax (e.g. `cargo +nightly`). `rustup` is
44
# required on the system in order to intercept the `cargo` commands and to install and use the appropriate toolchain with components.
5+
#
6+
# The root directory of this workspace is "virtual", it has no source code itself, just a holder of crates. This means
7+
# the cargo commands generally run on all the child crates by default without the `--workspace` flag.
58

69
NIGHTLY_TOOLCHAIN := "nightly-2025-07-10"
710
STABLE_TOOLCHAIN := "1.88.0"
@@ -18,27 +21,28 @@ STABLE_TOOLCHAIN := "1.88.0"
1821

1922
# Verify check, fails if anything is off. Good for CI.
2023
@_check-verify:
21-
# Cargo's wrapper for rustfmt predates workspaces, so uses the "--all" flag instead of "--workspaces".
22-
cargo +{{NIGHTLY_TOOLCHAIN}} fmt --check --all
24+
cargo +{{NIGHTLY_TOOLCHAIN}} fmt --check
2325
# Lint all workspace members. Enable all feature flags. Check all targets (tests, examples) along with library code. Turn warnings into errors.
24-
cargo +{{NIGHTLY_TOOLCHAIN}} clippy --workspace --all-features --all-targets -- -D warnings
25-
# Static analysis of types and lifetimes.
26-
# Nightly toolchain required by benches target.
27-
cargo +{{NIGHTLY_TOOLCHAIN}} check --workspace --all-features --all-targets
26+
cargo +{{NIGHTLY_TOOLCHAIN}} clippy --all-features --all-targets -- -D warnings
27+
# Static analysis of types and lifetimes. Nightly toolchain required by benches target.
28+
cargo +{{NIGHTLY_TOOLCHAIN}} check --all-features --all-targets
2829
# Build documentation to catch any broken doc links or invalid rustdoc.
29-
RUSTDOCFLAGS="-D warnings" cargo +{{STABLE_TOOLCHAIN}} doc --workspace --all-features --no-deps
30+
RUSTDOCFLAGS="-D warnings" cargo +{{STABLE_TOOLCHAIN}} doc --all-features --no-deps
3031

3132
# Attempt any auto-fixes for format and lints.
3233
@_check-fix:
3334
# No --check flag to actually apply formatting.
34-
cargo +{{NIGHTLY_TOOLCHAIN}} fmt --all
35+
cargo +{{NIGHTLY_TOOLCHAIN}} fmt
3536
# Adding --fix flag to apply suggestions with --allow-dirty.
36-
cargo +{{NIGHTLY_TOOLCHAIN}} clippy --workspace --all-features --all-targets --fix --allow-dirty -- -D warnings
37+
cargo +{{NIGHTLY_TOOLCHAIN}} clippy --all-features --all-targets --fix --allow-dirty -- -D warnings
3738

38-
# Run a test suite: features, msrv, constraints, or no-std.
39+
# Run a test suite: features, msrv, constraints, no-std, or all.
3940
@test suite="features":
4041
just _test-{{suite}}
4142

43+
# Run all test suites.
44+
@_test-all: _test-features _test-msrv _test-constraints _test-no-std
45+
4246
# Test library with feature flag matrix compatability.
4347
@_test-features:
4448
# Test the extremes: all features enabled as well as none. If features are additive, this should expose conflicts.
@@ -62,10 +66,10 @@ STABLE_TOOLCHAIN := "1.88.0"
6266
# Enabling "--all-features" so all dependencies are checked.
6367
# Clear any previously resolved versions and re-resolve to the minimums.
6468
rm -f Cargo.lock
65-
cargo +{{NIGHTLY_TOOLCHAIN}} check --workspace --all-features -Z direct-minimal-versions
69+
cargo +{{NIGHTLY_TOOLCHAIN}} check --all-features -Z direct-minimal-versions
6670
# Clear again and check the maximums by ignoring any rust-version caps.
6771
rm -f Cargo.lock
68-
cargo +{{NIGHTLY_TOOLCHAIN}} check --workspace --all-features --ignore-rust-version
72+
cargo +{{NIGHTLY_TOOLCHAIN}} check --all-features --ignore-rust-version
6973
rm -f Cargo.lock
7074

7175
# Test no standard library support.
@@ -88,7 +92,7 @@ STABLE_TOOLCHAIN := "1.88.0"
8892
# Generate HTML coverage report.
8993
protocol/fuzz/coverage.sh {{NIGHTLY_TOOLCHAIN}} {{target}}
9094

91-
# Add a release tag and publish to the upstream remote. Need write privileges on the repository.
95+
# Add a release tag and publish to the upstream remote. Requires write privileges.
9296
@tag crate version remote="upstream":
9397
# Guardrails: on a clean main with updated changelog and manifest.
9498
if ! git diff --quiet || ! git diff --cached --quiet; then \

0 commit comments

Comments
 (0)