Add formatting check to CI
Add code to the CI script, guarded on env var `DO_FMT` to run the formatter. Add a formatting job to the nightly CI job as a separate step, in a similar fashion to how the other nightly steps are done.
This commit is contained in:
parent
c7807dff9c
commit
0516ddeb8d
|
@ -18,6 +18,10 @@ jobs:
|
|||
toolchain: nightly
|
||||
override: true
|
||||
components: rust-src
|
||||
- name: Check formatting
|
||||
env:
|
||||
DO_FMT: true
|
||||
run: ./contrib/test.sh
|
||||
- name: Running address sanitizer
|
||||
env:
|
||||
DO_ASAN: true
|
||||
|
|
|
@ -88,6 +88,15 @@ if [ "$DO_ASAN" = true ]; then
|
|||
cargo run --release --features=alloc --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified alloc Successfully"
|
||||
fi
|
||||
|
||||
# Run formatter if told to.
|
||||
if [ "$DO_FMT" = true ]; then
|
||||
if [ "$NIGHTLY" = false ]; then
|
||||
echo "DO_FMT requires a nightly toolchain (consider using RUSTUP_TOOLCHAIN)"
|
||||
exit 1
|
||||
fi
|
||||
rustup component add rustfmt
|
||||
cargo fmt --check || exit 1
|
||||
fi
|
||||
|
||||
# Bench if told to, only works with non-stable toolchain (nightly, beta).
|
||||
if [ "$DO_BENCH" = true ]
|
||||
|
|
Loading…
Reference in New Issue