forked from jamesmunns/postcard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.sh
executable file
·44 lines (34 loc) · 1.08 KB
/
ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
set -ex
has_target() {
rustup target list --installed | grep -q "$1"
}
ensure_target() {
has_target "$1" || rustup target add "$1"
}
ensure_target thumbv7em-none-eabi
ensure_target riscv32i-unknown-none-elf
has_toolchain() {
rustup toolchain list | grep -q "$1"
}
ensure_toolchain() {
has_toolchain "$1" || rustup toolchain install "$1"
}
ensure_toolchain nightly
cargo_check() {
cargo check --all "$@"
cargo clippy --all "$@" -- --deny=warnings
}
cargo_test() {
cargo_check --all-targets "$@"
cargo test --all "$@"
}
cargo_test --features=alloc,experimental-derive,use-std,use-crc
cargo_check --target=thumbv7em-none-eabi --no-default-features
cargo_check --target=thumbv7em-none-eabi --features=alloc,experimental-derive
# CC https://github.com/jamesmunns/postcard/issues/167 - don't accidentally use atomics
# on non-atomic systems
cargo_check --target=riscv32i-unknown-none-elf --features=alloc,experimental-derive
cargo fmt --all -- --check
# Check docs.rs build
env RUSTDOCFLAGS='--cfg=docsrs --deny=warnings' cargo +nightly doc --all --no-deps --all-features