Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run MSRV checks with minimal dep versions #670

Merged
merged 10 commits into from Jun 17, 2022
58 changes: 44 additions & 14 deletions .github/workflows/CI.yml
Expand Up @@ -6,21 +6,18 @@ on:
- master
pull_request: {}

env:
MSRV: 1.49.0

jobs:
check:
check-stable:
# Run `cargo check` first to ensure that the pushed code at least compiles.
runs-on: ubuntu-latest
strategy:
# Disable fail-fast. If the test run for a particular Rust version fails,
# don't cancel the other test runs, so that we can determine whether a
# failure only occurs on a particular version.
fail-fast: false
matrix:
rust: [stable, 1.49.0]
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
toolchain: stable
profile: minimal
override: true
- name: Check
Expand All @@ -43,6 +40,22 @@ jobs:
RUSTDOCFLAGS: "-D rustdoc::broken_intra_doc_links"
run: cargo doc --all-features --no-deps

check-msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: "install Rust ${{ env.MSRV }}"
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.MSRV }}
profile: minimal
- name: install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions
- name: Check
run: cargo minimal-versions check --all --all-targets --all-features

cargo-hack:
runs-on: ubuntu-latest
steps:
Expand All @@ -51,9 +64,8 @@ jobs:
with:
toolchain: stable
profile: minimal
- 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
- name: install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo hack check
working-directory: ${{ matrix.subcrate }}
run: cargo hack check --each-feature --no-dev-deps --workspace
Expand All @@ -68,10 +80,11 @@ jobs:
# failure only occurs on a particular version.
fail-fast: false
matrix:
rust: [stable, beta, nightly, 1.49.0]
rust: [stable, beta, nightly]
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
- name: "install Rust ${{ matrix.rust }}"
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
Expand All @@ -82,6 +95,23 @@ jobs:
command: test
args: --workspace --all-features

test-msrv:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: "install Rust ${{ env.MSRV }}"
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.MSRV }}
profile: minimal
- name: install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions
- name: Run tests
run: cargo minimal-versions test --all --all-targets --all-features

style:
needs: check
runs-on: ubuntu-latest
Expand Down