aboutsummaryrefslogtreecommitdiff
path: root/ci/script.sh
blob: 7c309935d9628e75c38d2a3e2422a7776e950de8 (plain) (blame)
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
45
set -euxo pipefail

main() {
    if [ $TRAVIS_RUST_VERSION = nightly ]; then
        export RUSTFLAGS="-D warnings"
    fi

    cargo check --target $TARGET

    if [ $TRAVIS_RUST_VERSION = nightly ]; then
        cargo check --target $TARGET --features 'inline-asm'
    fi

    case $TARGET in
        thumbv7em-none-eabi*)
            cargo check --target $TARGET --features cm7-r0p1

            if [ $TRAVIS_RUST_VERSION = nightly ]; then
                cargo check --target $TARGET --features 'cm7-r0p1 inline-asm'
            fi
            ;;

        thumbv*-none-eabi*)
            ;;

        x86_64-unknown-linux-gnu)
            cargo test --target $TARGET
            ;;
    esac

    if [ $TARGET = x86_64-unknown-linux-gnu ]; then
        ./check-blobs.sh
    fi

    if [ $TRAVIS_RUST_VERSION = nightly ]; then
        # Get the latest nightly with a working clippy
        rustup toolchain uninstall nightly
        rustup set profile default
        rustup default nightly
        rustup target add $TARGET
        cargo clippy --target $TARGET -- -D warnings
    fi
}

main