Skip to content

Commit 9646c86

Browse files
torokati44Dinnerbone
authored andcommitted
ci: Split Rust lint checks into their own job
1 parent 1651b7a commit 9646c86

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

.github/workflows/test_rust.yml

+41-20
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,6 @@ jobs:
6868
shared-key: "desktop"
6969
save-if: ${{ github.ref == 'refs/heads/master' }}
7070

71-
- name: Check formatting
72-
if: runner.os == 'Linux'
73-
run: cargo fmt --all -- --check
74-
75-
- name: Check clippy
76-
# not critical on other platforms, and slows down Windows
77-
if: runner.os == 'Linux'
78-
# Don't fail the build for clippy on nightly, since we get a lot of false-positives
79-
run: cargo clippy --all --all-features --tests ${{ (matrix.rust_version != 'nightly' && '-- -D warnings') || '' }}
80-
81-
- name: Check licensing and duplicates in used crates
82-
if: ${{ runner.os == 'Linux' && matrix.rust_version == 'stable' }}
83-
uses: EmbarkStudios/cargo-deny-action@v1
84-
85-
- name: Check documentation
86-
if: runner.os == 'Linux'
87-
run: cargo doc --no-deps --all-features
88-
env:
89-
RUSTDOCFLAGS: -D warnings
90-
9171
- name: Install cargo nextest
9272
uses: taiki-e/install-action@v2
9373
with:
@@ -116,6 +96,47 @@ jobs:
11696
tests*/**/*.actual*.png
11797
tests*/**/*.difference*.png
11898
99+
lints:
100+
needs: changes
101+
if: needs.changes.outputs.should_run== 'true'
102+
name: Lints with Rust ${{ matrix.rust_version }}
103+
runs-on: ubuntu-22.04
104+
continue-on-error: ${{ matrix.rust_version == 'nightly' || matrix.rust_version == 'beta' }}
105+
strategy:
106+
fail-fast: false
107+
matrix:
108+
rust_version: [stable, beta, nightly]
109+
110+
steps:
111+
- uses: actions/checkout@v4
112+
113+
- name: Install Rust toolchain
114+
uses: dtolnay/rust-toolchain@stable
115+
with:
116+
toolchain: ${{ matrix.rust_version }}
117+
components: rustfmt, clippy
118+
119+
- name: Install Linux dependencies
120+
run: |
121+
sudo apt-get update
122+
sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libgtk-3-dev mesa-vulkan-drivers libpango1.0-dev
123+
124+
- name: Check formatting
125+
run: cargo fmt --all -- --check
126+
127+
- name: Check clippy
128+
# Don't fail the build for clippy on nightly, since we get a lot of false-positives
129+
run: cargo clippy --all --all-features --tests ${{ (matrix.rust_version != 'nightly' && '-- -D warnings') || '' }}
130+
131+
- name: Check licensing and duplicates in used crates
132+
if: ${{ matrix.rust_version == 'stable' }}
133+
uses: EmbarkStudios/cargo-deny-action@v1
134+
135+
- name: Check documentation
136+
run: cargo doc --no-deps --all-features
137+
env:
138+
RUSTDOCFLAGS: -D warnings
139+
119140
check-required:
120141
needs: changes
121142
if: needs.changes.outputs.should_run == 'false'

0 commit comments

Comments
 (0)