fix linter?

This commit is contained in:
2024-11-03 17:22:32 +01:00
parent ae2458a159
commit 612c6844fc

View File

@@ -4,84 +4,98 @@ name: lint
jobs: jobs:
check: check:
name: Check (${{ matrix.os }})
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- target: i686-pc-windows-msvc - target: i686-pc-windows-msvc
os: windows-latest os: windows-latest
- target: x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
continue-on-error: true
name: Check
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout sources - uses: actions/checkout@v4
uses: actions/checkout@v4
- name: Install stable toolchain - name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: stable target: ${{ matrix.target }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run cargo check - name: Run cargo check
uses: clechasseur/rs-cargo@v2 run: cargo check --target ${{ matrix.target }}
with:
command: check
test: test:
name: Test (${{ matrix.os }})
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- target: i686-pc-windows-msvc - target: i686-pc-windows-msvc
os: windows-latest os: windows-latest
- target: x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
continue-on-error: true
name: Test Suite
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout sources - uses: actions/checkout@v4
uses: actions/checkout@v4
- name: Install stable toolchain - name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: stable target: ${{ matrix.target }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run cargo test - name: Run cargo test
uses: clechasseur/rs-cargo@v2 run: cargo test --target ${{ matrix.target }}
with:
command: test
lints: lints:
name: Lints (${{ matrix.os }})
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- target: i686-pc-windows-msvc - target: i686-pc-windows-msvc
os: windows-latest os: windows-latest
- target: x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
continue-on-error: true
name: Lints
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout sources - uses: actions/checkout@v4
uses: actions/checkout@v4
- name: Install stable toolchain - name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: stable target: ${{ matrix.target }}
components: rustfmt, clippy components: rustfmt, clippy
- name: Run cargo fmt - name: Cache dependencies
uses: clechasseur/rs-cargo@v2 uses: actions/cache@v4
with: with:
command: fmt path: |
args: --all -- --check ~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy - name: Run cargo clippy
uses: clechasseur/rs-cargo@v2 run: cargo clippy --target ${{ matrix.target }} -- -D warnings
with:
command: clippy
args: -- -D warnings