Skip to content

Commit

Permalink
Add MSRV and add CI step to validate
Browse files Browse the repository at this point in the history
Also, restructure CI workflow to run all checks in parallel. This _may_
reduce the overall time required to run checks on PRs.
  • Loading branch information
spencewenski committed May 17, 2024
1 parent 6c55c10 commit 2d52a2b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
jobs:
# `cargo hack --each-feature` runs the given command for each feature, including "no features", "all features",
# and the `default` feature.
roadster_each_feature:
name: Each feature
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -22,13 +22,47 @@ jobs:
- uses: taiki-e/install-action@nextest
- name: Test
run: cargo hack nextest run --no-fail-fast --each-feature --workspace

doc_test:
name: Doc tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- name: Doc test
run: cargo hack test --doc --no-fail-fast --each-feature --workspace

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- name: Check
run: cargo hack check --each-feature --no-dev-deps --workspace

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- name: Clippy
run: cargo hack clippy --workspace --all-targets --each-feature -- -D warnings

# https://doc.rust-lang.org/cargo/guide/continuous-integration.html#verifying-rust-version
msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- run: cargo hack check --rust-version --workspace --all-targets --ignore-private

check_formatting:
name: Formatting
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ repository = "https://github.com/roadster-rs/roadster"
license = "MIT OR Apache-2.0"
keywords = ["web", "framework"]
categories = ["web-programming", "web-programming::http-server"]
# Determined using `cargo msrv` -- https://github.com/foresterre/cargo-msrv
rust-version = "1.74.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down

0 comments on commit 2d52a2b

Please sign in to comment.