Skip to content

Commit b84754b

Browse files
committed
Auto merge of rust-lang#2261 - RalfJung:fmt, r=oli-obk
make rustfmt mandatory and used pinned toolchain Looks like this is what most people prefer/expect, and using a pinned toolchain for formatting avoids some (rare and so far mostly hypothetical) formatting inconsistency issues.
2 parents c38e1e9 + e286090 commit b84754b

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

.github/workflows/ci.yml

+17-26
Original file line numberDiff line numberDiff line change
@@ -86,42 +86,33 @@ jobs:
8686
- name: Test
8787
run: bash ./ci.sh
8888

89-
clippy:
90-
name: clippy + rustdoc
89+
style:
90+
name: style checks
9191
runs-on: ubuntu-latest
9292
steps:
9393
- uses: actions/checkout@v3
9494
- name: Install required toolchain
9595
# We need a toolchain that can actually build Miri, just a nightly won't do.
9696
run: |
9797
cargo install rustup-toolchain-install-master # TODO: cache this?
98-
./rustup-toolchain "" -c clippy
99-
- name: Clippy (miri)
98+
./rustup-toolchain "" -c clippy -c rustfmt
99+
- name: rustfmt (miri, ui_test)
100+
run: cargo fmt --all --check
101+
- name: rustfmt (everything else)
102+
# TODO: Add `tests` (work in progress).
103+
# Maybe change to `find . -name '*.rs'`, superseding the previous step.
104+
run: |
105+
find bench-cargo-miri benches cargo-miri test-cargo-miri -name '*.rs' \
106+
| xargs rustfmt --edition=2021 --config-path ./rustfmt.toml --check
107+
- name: clippy (miri)
100108
run: cargo clippy --all-targets -- -D warnings
101109
#- name: Clippy (ui_test)
102110
# run: cargo clippy --manifest-path ui_test/Cargo.toml --all-targets -- -D warnings
103-
- name: Clippy (cargo-miri)
111+
- name: clippy (cargo-miri)
104112
run: cargo clippy --manifest-path cargo-miri/Cargo.toml --all-targets -- -D warnings
105-
- name: Rustdoc
113+
- name: rustdoc
106114
run: RUSTDOCFLAGS="-Dwarnings" cargo doc --document-private-items
107115

108-
fmt:
109-
name: formatting (ignored by bors)
110-
runs-on: ubuntu-latest
111-
steps:
112-
- uses: actions/checkout@v3
113-
- name: Install latest nightly
114-
run: |
115-
rustup toolchain install nightly --component rustfmt
116-
rustup override set nightly
117-
- name: Formatting (miri, ui_test)
118-
run: cargo fmt --all --check
119-
- name: Formatting (everything else)
120-
# TODO: Add `tests` (work in progress).
121-
# Maybe change to `find . -name '*.rs'`, superseding the previous step.
122-
run: find bench-cargo-miri benches cargo-miri test-cargo-miri -name '*.rs'
123-
| xargs rustfmt --edition=2021 --config-path ./rustfmt.toml --check
124-
125116
# These jobs doesn't actually test anything, but they're only used to tell
126117
# bors the build completed, as there is no practical way to detect when a
127118
# workflow is successful listening to webhooks only.
@@ -131,15 +122,15 @@ jobs:
131122
end-success:
132123
name: bors build finished
133124
runs-on: ubuntu-latest
134-
needs: [build, clippy]
125+
needs: [build, style]
135126
if: github.event.pusher.name == 'bors' && success()
136127
steps:
137128
- name: mark the job as a success
138129
run: exit 0
139130
end-failure:
140131
name: bors build finished
141132
runs-on: ubuntu-latest
142-
needs: [build, clippy]
133+
needs: [build, style]
143134
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
144135
steps:
145136
- name: mark the job as a failure
@@ -149,7 +140,7 @@ jobs:
149140
cron-fail-notify:
150141
name: cronjob failure notification
151142
runs-on: ubuntu-latest
152-
needs: [build, clippy]
143+
needs: [build, style]
153144
if: github.event_name == 'schedule' && (failure() || cancelled())
154145
steps:
155146
- name: Install zulip-send

0 commit comments

Comments
 (0)