Skip to content

Commit

Permalink
Merge branch 'main' into david/nested-path
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpdrsn committed Apr 19, 2023
2 parents 172a74e + c31bea2 commit 8064f4d
Show file tree
Hide file tree
Showing 20 changed files with 320 additions and 174 deletions.
213 changes: 74 additions & 139 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,23 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: arduino/setup-protoc@v1
- uses: actions/checkout@v3
- uses: taiki-e/install-action@protoc
- uses: dtolnay/rust-toolchain@beta
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: beta
override: true
profile: minimal
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets --all-features
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt --all --check

check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: cargo doc
env:
RUSTDOCFLAGS: "-D rustdoc::all -A rustdoc::private-doc-tests"
Expand All @@ -54,14 +39,10 @@ jobs:
cargo-hack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: arduino/setup-protoc@v1
- uses: actions/checkout@v3
- uses: taiki-e/install-action@protoc
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Install cargo-hack
run: |
curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
Expand All @@ -74,13 +55,9 @@ jobs:
matrix:
crate: [axum, axum-core, axum-extra, axum-macros]
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Install cargo-public-api-crates
run: |
cargo install --git https://github.com/davidpdrsn/cargo-public-api-crates
Expand All @@ -94,110 +71,80 @@ jobs:
matrix:
rust: [stable, beta]
steps:
- uses: actions/checkout@master
- uses: arduino/setup-protoc@v1
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v3
- uses: taiki-e/install-action@protoc
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --all-features --all-targets
run: cargo test --workspace --all-features --all-targets

# some examples doesn't support our MSRV so we only test axum itself on our MSRV
test-nightly:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v3
- name: Get rust-toolchain version
id: rust-toolchain
run: echo "version=$(cat axum-macros/rust-toolchain)" >> $GITHUB_OUTPUT
- uses: dtolnay/rust-toolchain@master
with:
# same as `axum-macros/rust-toolchain`
toolchain: nightly-2023-04-06
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
toolchain: ${{ steps.rust-toolchain.outputs.version }}
- uses: Swatinem/rust-cache@v2
- name: Run nightly tests
working-directory: axum-macros
run: |
cargo test
run: cargo test

# some examples doesn't support our MSRV (such as async-graphql)
# so we only test axum itself on our MSRV
test-msrv:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
override: true
profile: minimal
- name: "install Rust nightly"
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Select minimal versions
uses: actions-rs/cargo@v1
with:
command: update
args: -Z minimal-versions
toolchain: nightly
uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Select minimal version
run: cargo +nightly update -Z minimal-versions
- name: Fix up Cargo.lock
uses: actions-rs/cargo@v1
with:
command: update
args: -p crc32fast --precise 1.1.1
toolchain: nightly
run: cargo +nightly update -p crc32fast --precise 1.1.1
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: >
-p axum
-p axum-extra
-p axum-core
--all-features
--all-targets
--locked
toolchain: ${{ env.MSRV }}
run: >
cargo +${{ env.MSRV }}
test
-p axum
-p axum-extra
-p axum-core
--all-features
--all-targets
--locked
# the compiler errors are different on our MSRV which makes
# the trybuild tests in axum-macros fail, so just run the doc
# tests
- name: Run axum-macros doc tests
uses: actions-rs/cargo@v1
with:
command: test
args: >
-p axum-macros
--doc
--all-features
--locked
toolchain: ${{ env.MSRV }}
run: >
cargo +${{ env.MSRV }}
test
-p axum-macros
--doc
--all-features
--locked
test-docs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Run doc tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --doc
run: cargo test --all-features --doc

deny-check:
name: cargo-deny check
Expand All @@ -209,7 +156,7 @@ jobs:
- advisories
- bans licenses sources
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
Expand All @@ -219,59 +166,47 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: armv5te-unknown-linux-musleabi
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Check
uses: actions-rs/cargo@v1
env:
# Clang has native cross-compilation support
CC: clang
with:
command: check
args: >
--all-targets
--all-features
-p axum
-p axum-core
-p axum-extra
-p axum-macros
--target armv5te-unknown-linux-musleabi
run: >
cargo
check
--all-targets
--all-features
-p axum
-p axum-core
-p axum-extra
-p axum-macros
--target armv5te-unknown-linux-musleabi
wasm32-unknown-unknown:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: >
--manifest-path ./examples/simple-router-wasm/Cargo.toml
--target wasm32-unknown-unknown
run: >
cargo
check
--manifest-path ./examples/simple-router-wasm/Cargo.toml
--target wasm32-unknown-unknown
dependencies-are-sorted:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: beta
override: true
profile: minimal
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@beta
- uses: Swatinem/rust-cache@v2
- name: Install cargo-sort
run: |
Expand Down
1 change: 1 addition & 0 deletions axum-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#![allow(elided_lifetimes_in_paths, clippy::type_complexity)]
#![forbid(unsafe_code)]
#![cfg_attr(test, allow(clippy::float_cmp))]
#![cfg_attr(not(test), warn(clippy::print_stdout, clippy::dbg_macro))]

#[macro_use]
pub(crate) mod macros;
Expand Down
9 changes: 9 additions & 0 deletions axum-extra/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning].

- None.

# 0.7.4 (18. April, 2023)

- **added:** Add `Html` response type ([#1921])
- **added:** Add `Css` response type ([#1921])
- **added:** Add `JavaScript` response type ([#1921])
- **added:** Add `Wasm` response type ([#1921])

[#1921]: https://github.com/tokio-rs/axum/pull/1921

# 0.7.3 (11. April, 2023)

- **added:** Implement `Deref` and `DerefMut` for built-in extractors ([#1922])
Expand Down
2 changes: 1 addition & 1 deletion axum-extra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
name = "axum-extra"
readme = "README.md"
repository = "https://github.com/tokio-rs/axum"
version = "0.7.3"
version = "0.7.4"

[features]
default = []
Expand Down
1 change: 1 addition & 0 deletions axum-extra/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#![forbid(unsafe_code)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(test, allow(clippy::float_cmp))]
#![cfg_attr(not(test), warn(clippy::print_stdout, clippy::dbg_macro))]

#[allow(unused_extern_crates)]
extern crate self as axum_extra;
Expand Down
Loading

0 comments on commit 8064f4d

Please sign in to comment.