summaryrefslogtreecommitdiffstats
path: root/ci/script.sh
blob: 87dc872fc1ebbe41fe46b18ed75cb23ed4cc1748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# Run clippy checks
if [ "$CLIPPY" == "true" ]; then
    cargo clippy --all-targets
    exit
fi

# Run clippy rustfmt
if [ "$RUSTFMT" == "true" ]; then
    cargo fmt -- --check
    exit
fi

# Run test in release mode if a tag is present, to produce an optimized binary
if [ -n "$TRAVIS_TAG" ]; then
    # Build separately so we generate an 'alacritty' binary without -HASH appended
    cargo build --release
    cargo test --release
else
    cargo test
fi