Only run clippy for the stable rust version

This commit is contained in:
Steve Myers 2021-12-14 22:06:06 -08:00
parent f7f9bd2409
commit 57a1185aef
No known key found for this signature in database
GPG Key ID: 8105A46B22C2D051

View File

@ -10,8 +10,9 @@ jobs:
strategy: strategy:
matrix: matrix:
rust: rust:
- 1.56.0 # STABLE - version: 1.56.0 # STABLE
- 1.46.0 # MSRV clippy: true
- version: 1.46.0 # MSRV
features: features:
- default - default
- minimal - minimal
@ -31,7 +32,7 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Generate cache key - name: Generate cache key
run: echo "${{ matrix.rust }} ${{ matrix.features }}" | tee .cache_key run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key
- name: cache - name: cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
@ -41,16 +42,18 @@ jobs:
target target
key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain - name: Set default toolchain
run: rustup default ${{ matrix.rust }} run: rustup default ${{ matrix.rust.version }}
- name: Set profile - name: Set profile
run: rustup set profile minimal run: rustup set profile minimal
- name: Add clippy - name: Add clippy
if: ${{ matrix.rust.clippy }}
run: rustup component add clippy run: rustup component add clippy
- name: Update toolchain - name: Update toolchain
run: rustup update run: rustup update
- name: Build - name: Build
run: cargo build --features ${{ matrix.features }} --no-default-features run: cargo build --features ${{ matrix.features }} --no-default-features
- name: Clippy - name: Clippy
if: ${{ matrix.rust.clippy }}
run: cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings run: cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
- name: Test - name: Test
run: cargo test --features ${{ matrix.features }} --no-default-features run: cargo test --features ${{ matrix.features }} --no-default-features