ci: Split Rust lint checks into their own job
This commit is contained in:
parent
1651b7a5b0
commit
9646c86707
|
@ -68,26 +68,6 @@ jobs:
|
|||
shared-key: "desktop"
|
||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: Check formatting
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
- name: Check clippy
|
||||
# not critical on other platforms, and slows down Windows
|
||||
if: runner.os == 'Linux'
|
||||
# Don't fail the build for clippy on nightly, since we get a lot of false-positives
|
||||
run: cargo clippy --all --all-features --tests ${{ (matrix.rust_version != 'nightly' && '-- -D warnings') || '' }}
|
||||
|
||||
- name: Check licensing and duplicates in used crates
|
||||
if: ${{ runner.os == 'Linux' && matrix.rust_version == 'stable' }}
|
||||
uses: EmbarkStudios/cargo-deny-action@v1
|
||||
|
||||
- name: Check documentation
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc --no-deps --all-features
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
|
||||
- name: Install cargo nextest
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
|
@ -116,6 +96,47 @@ jobs:
|
|||
tests*/**/*.actual*.png
|
||||
tests*/**/*.difference*.png
|
||||
|
||||
lints:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.should_run== 'true'
|
||||
name: Lints with Rust ${{ matrix.rust_version }}
|
||||
runs-on: ubuntu-22.04
|
||||
continue-on-error: ${{ matrix.rust_version == 'nightly' || matrix.rust_version == 'beta' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
rust_version: [stable, beta, nightly]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: ${{ matrix.rust_version }}
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libgtk-3-dev mesa-vulkan-drivers libpango1.0-dev
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
- name: Check clippy
|
||||
# Don't fail the build for clippy on nightly, since we get a lot of false-positives
|
||||
run: cargo clippy --all --all-features --tests ${{ (matrix.rust_version != 'nightly' && '-- -D warnings') || '' }}
|
||||
|
||||
- name: Check licensing and duplicates in used crates
|
||||
if: ${{ matrix.rust_version == 'stable' }}
|
||||
uses: EmbarkStudios/cargo-deny-action@v1
|
||||
|
||||
- name: Check documentation
|
||||
run: cargo doc --no-deps --all-features
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
|
||||
check-required:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.should_run == 'false'
|
||||
|
|
Loading…
Reference in New Issue