Skip to content

Commit d2a9917

Browse files
committed
ci: clippy dev: restore rust-toolchain file
Previously, we removed the rust-toolchain file in ci and that used the toolchain action to install rustfmt and run `cargo dev fmt`. For testing lintcheck however, we need the rust-toolchain file and a pinned nightly version to build clippy. Solution: First remove the rust-toolchain file and check the formatting. Then restore the toolchain file from the git repo and run the other tests
1 parent 3c72f0b commit d2a9917

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/clippy_dev.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- name: Checkout
2626
uses: actions/[email protected]
2727

28+
# To test formatting, we need to temporarily disable the rust-toolchain file
2829
- name: remove toolchain file
2930
run: rm rust-toolchain
3031

@@ -37,6 +38,13 @@ jobs:
3738
components: rustfmt
3839
default: true
3940

41+
- name: Test fmt
42+
run: cargo dev fmt --check
43+
44+
# Restore the rust-toolchain-file
45+
- name: Restore rust-toolchain-file
46+
run: git checkout rust-toolchain
47+
4048
# Run
4149
- name: Build
4250
run: cargo build --features deny-warnings
@@ -48,9 +56,6 @@ jobs:
4856
- name: Test update_lints
4957
run: cargo dev update_lints --check
5058

51-
- name: Test fmt
52-
run: cargo dev fmt --check
53-
5459
# Lintcheck
5560
- name: build lintcheck
5661
run: cargo build --features lintcheck,deny-warnings

0 commit comments

Comments
 (0)