Use minimal dependency versions for MSRV tests on CI (#1109)

This commit is contained in:
David Pedersen 2022-06-27 20:44:20 +02:00 committed by GitHub
parent cb207472f4
commit f6b1d35c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 8 deletions

View file

@ -2,6 +2,7 @@ name: CI
env:
CARGO_TERM_COLOR: always
MSRV: 1.56.0
on:
push:
@ -88,8 +89,8 @@ jobs:
command: test
args: --all --all-features --all-targets
# some examples doesn't support 1.56 (such as async-graphql)
# so we only test axum itself on 1.56
# 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
@ -97,10 +98,21 @@ jobs:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56
toolchain: ${{ env.MSRV }}
override: true
profile: minimal
- name: "install Rust nightly"
uses: actions-rs/toolchain@v1
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
- name: Run tests
uses: actions-rs/cargo@v1
with:
@ -109,8 +121,12 @@ jobs:
-p axum
-p axum-extra
-p axum-core
--all-features --all-targets
# the compiler errors are different on 1.56 which makes
-p internal-minimal-versions
--all-features
--all-targets
--locked
toolchain: ${{ env.MSRV }}
# 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
@ -119,8 +135,11 @@ jobs:
command: test
args: >
-p axum-macros
-p internal-minimal-versions
--doc
--all-features
--locked
toolchain: ${{ env.MSRV }}
test-docs:
needs: check

View file

@ -4,4 +4,9 @@ members = [
"axum-core",
"axum-extra",
"axum-macros",
# internal crate used to bump the minimum versions we
# get for some dependencies which otherwise wouldn't build
# with `cargo +nightly update -Z minimal-versions`
"internal-minimal-versions",
]

View file

@ -26,4 +26,4 @@ rustversion = "1.0"
serde = { version = "1.0", features = ["derive"] }
syn = { version = "1.0", features = ["full", "extra-traits"] }
tokio = { version = "1.0", features = ["full"] }
trybuild = "1.0"
trybuild = "1.0.63"

View file

@ -48,7 +48,7 @@ tower-service = "0.3"
# optional dependencies
base64 = { version = "0.13", optional = true }
headers = { version = "0.3", optional = true }
headers = { version = "0.3.7", optional = true }
multer = { version = "2.0.0", optional = true }
serde_json = { version = "1.0", features = ["raw_value"], optional = true }
serde_urlencoded = { version = "0.7", optional = true }
@ -60,7 +60,7 @@ anyhow = "1.0"
futures = "0.3"
quickcheck = "1.0"
quickcheck_macros = "1.0"
reqwest = { version = "0.11", default-features = false, features = ["json", "stream", "multipart"] }
reqwest = { version = "0.11.11", default-features = false, features = ["json", "stream", "multipart"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.6.1", features = ["macros", "rt", "rt-multi-thread", "net", "test-util"] }

View file

@ -0,0 +1,16 @@
[package]
name = "internal-minimal-versions"
version = "0.1.0"
edition = "2021"
publish = false
# these dependencies don't build if installed with `cargo +nightly update -Z
# minimal-versions` so we add them here to make sure we get a version that
# does build
#
# this only matters for axum's CI
[dependencies]
crc32fast = "1.3.2"
gcc = "0.3.55"
time = "0.3.9"
tungstenite = "0.17.2"

View file

@ -0,0 +1 @@
// intentionally left empty