refactor ci.yml, bump MSRV to 1.75 #148
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
env: | |
MSRV: '1.75' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/install-action@protoc | |
- uses: dtolnay/rust-toolchain@beta | |
with: | |
components: clippy, rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- name: clippy | |
run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
- name: rustfmt | |
run: cargo fmt --all --check | |
check-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo doc | |
env: | |
RUSTDOCFLAGS: "-D rustdoc::all -A rustdoc::private-doc-tests" | |
run: cargo doc --all-features --no-deps | |
test-versions: | |
needs: check | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: [stable, beta, nightly] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build System Info | |
run: rustc --version | |
- name: Run tests default features | |
run: cargo test | |
- name: Run tests no features | |
run: cargo test --no-default-features | |
- name: Run tests all features | |
run: cargo test --all-features | |
test-msrv: | |
needs: check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.MSRV }} | |
- name: "install Rust nightly" | |
uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
- name: Select minimal version | |
run: cargo +nightly update -Z minimal-versions | |
- name: Run tests all features | |
run: cargo test --all-features |