fix: min version for build is 1.65.0 now #20
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 | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
CI: 1 | |
jobs: | |
clippy: | |
name: Clippy validation${{ matrix.all-features && ' with all features' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
all-features: [ false, true ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust with clippy | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: clippy | |
cache: false | |
- name: Run clippy | |
uses: clechasseur/rs-clippy-check@v3 | |
with: | |
args: --workspace --all-targets ${{ matrix.all-features && '--all-features' || '' }} -- -D warnings | |
fmt: | |
name: Rustfmt check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust nightly with rustfmt | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt | |
cache: false | |
- name: Run Rustfmt | |
uses: clechasseur/rs-fmt-check@v2 | |
with: | |
args: --all | |
msrv-check: | |
name: MSRV check for Rust ${{ matrix.toolchain }} on ${{ matrix.os }}${{ matrix.all-features && ' with all features' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ 1.56.1 ] | |
os: [ ubuntu, macos, windows ] | |
all-features: [ false, true ] | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust nightly toolchain | |
if: ${{ matrix.toolchain != 'nightly' }} | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
cache: false | |
- name: Install Rust toolchain ${{ matrix.toolchain }} | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
cache: false | |
- name: Install just | |
uses: extractions/setup-just@v1 | |
- name: Install cargo-minimal-versions | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-hack,cargo-minimal-versions | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: v4-rust | |
key: all-features-${{ matrix.all-features }}-msrv-cargo-files-${{ hashFiles('**/Cargo.*.msrv') }} | |
- name: Run checks using cargo-minimal-versions | |
run: just all_features=${{ matrix.all-features }} check-minimal | |
build: | |
name: Build for Rust ${{ matrix.toolchain }}${{ matrix.experimental && ' (experimental)' || '' }} on ${{ matrix.os }}${{ matrix.ignore-lock && ' without Cargo.lock' || '' }}${{ matrix.all-features && ' with all features' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ 1.65.0, stable, beta, nightly ] | |
os: [ ubuntu, macos, windows ] | |
ignore-lock: [ false, true ] | |
all-features: [ false, true ] | |
include: | |
- experimental: false | |
- toolchain: beta | |
experimental: true | |
- toolchain: nightly | |
experimental: true | |
runs-on: ${{ matrix.os }}-latest | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Remove Cargo.lock | |
if: ${{ matrix.ignore-lock }} | |
run: rm Cargo.lock | |
- name: Install Rust toolchain ${{ matrix.toolchain }} | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
cache: false | |
- name: Install just | |
uses: extractions/setup-just@v1 | |
- name: Rust Cache | |
if: ${{ !matrix.experimental }} | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: v1-rust | |
key: ignore-lock-${{ matrix.ignore-lock }}-all-features-${{ matrix.all-features }} | |
- name: Run checks | |
run: just all_features=${{ matrix.all-features }} check | |
- name: Run tests | |
run: just all_features=${{ matrix.all-features }} test | |
tarpaulin: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
cache: false | |
- name: Install cargo-tarpaulin | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-tarpaulin | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-targets: false | |
- name: Run cargo-tarpaulin | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: tarpaulin | |
- name: Upload code coverage results to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: | | |
cobertura.xml | |
tarpaulin-report.html | |
doc: | |
name: Rustdoc check for Rust ${{ matrix.toolchain }}${{ matrix.experimental && ' (experimental)' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ stable, nightly ] | |
include: | |
- experimental: false | |
- toolchain: nightly | |
experimental: true | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain ${{ matrix.toolchain }} | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
cache: false | |
- name: Install just | |
uses: extractions/setup-just@v1 | |
- name: Rust Cache | |
if: ${{ !matrix.experimental }} | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-targets: false | |
- name: Generate doc using rustdoc | |
run: just doc | |
publish-dry-run: | |
name: Publish dry-run | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
cache: false | |
- name: Install just | |
uses: extractions/setup-just@v1 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-targets: false | |
- name: Perform publish dry-run | |
uses: clechasseur/rs-cargo@v2 | |
with: | |
command: publish | |
args: --dry-run |