Split examples & check minimum versions (#3370)

Currently, both cargo deny and our MSRV checks use Cargo.lock file which has unified features and versions across both the axum crates and all the examples. This can hide some issues as usually when someone adds an example, they might use cargo add which will silently update the dependency for the whole repository. Some compilation errors (like axum requiring [email protected] while it uses features from [email protected]) will then be hidden.

I don't think most users would ever need to use the minimal versions anyway so this is not as severe, but someone might run into compilation errors.
This commit is contained in:
David Mládek
2025-12-02 22:24:37 +01:00
committed by GitHub
parent aeff16e91a
commit b9e35ec780
7 changed files with 5964 additions and 3672 deletions
+9 -1
View File
@@ -24,6 +24,8 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Check
run: cargo clippy --manifest-path examples/Cargo.toml --workspace --all-targets --all-features -- -D warnings
- name: rustfmt
run: cargo fmt --all --check
@@ -92,6 +94,8 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Run tests
run: cargo test --workspace --all-features --all-targets
- name: Test examples
run: cargo test --manifest-path examples/Cargo.toml --workspace --all-features --all-targets
# some examples don't support our MSRV so we only test axum itself on our MSRV
test-nightly:
@@ -129,8 +133,12 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Select minimal version
run: cargo +nightly update -Z minimal-versions
- name: Fix up Cargo.lock
- name: Fix up Cargo.lock - crc32fast
run: cargo +nightly update -p crc32fast --precise 1.1.1
- name: Fix up Cargo.lock - version_check
run : cargo +nightly update -p [email protected] --precise 0.1.4
- name: Fix up Cargo.lock - lazy_static
run: cargo +nightly update -p lazy_static --precise 1.1.0
- name: Run tests
run: >
cargo +${{ env.MSRV }}