-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
77 lines (73 loc) · 3.76 KB
/
.travis.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
dist: bionic
language: minimal
sudo: false
# Default `language: rust` has problems on nightly with rustfmt support
# only cache cargo subcommand binaries and .so libs
# the build artifacts take a lot of space and are slower to
# cache than to actually rebuild anyway...
# We need to cache the whole .cargo directory to keep the
# .crates.toml file.
cache:
directories:
- /home/travis/install
- /home/travis/.cargo
# But don't cache the cargo registry
before_cache:
- rm -rf "$HOME"/.cargo/registry
before_script:
- |
export PATH="$HOME/.cargo/bin:$PATH"
TRAVIS_RUST_VERSION="${TRAVIS_RUST_VERSION:-nightly}"
if [ "$TRAVIS_RUST_VERSION" = 'nightly' ]; then
printf -v RUSTFMT_VERSION '%s%s' '-' "$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustfmt)"
printf -v CLIPPY_VERSION '%s%s' '-' "$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy)"
SMALLEST_COMPAT_RUST="$([[ "$RUSTFMT_VERSION" < "$CLIPPY_VERSION" ]] && echo "$RUSTFMT_VERSION" || echo "$CLIPPY_VERSION")"
if command -v rustup 2>/dev/null; then
rustup default "${TRAVIS_RUST_VERSION}${SMALLEST_COMPAT_RUST}"
else
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain "${TRAVIS_RUST_VERSION}${SMALLEST_COMPAT_RUST}"
fi
fi
if command -v cargo >/dev/null; then
export PATH="$HOME/.cargo/bin:$PATH"
export XDG_RUNTIME_DIR="$PWD"'/socket'
mkdir "$XDG_RUNTIME_DIR"
cargo fetch
rustup component add rustfmt
fi
if [ -n "$CLIPPY" ]; then
rustup component add clippy --toolchain "${TRAVIS_RUST_VERSION}${SMALLEST_COMPAT_RUST}"
elif [ -n "$BUILD_FMT" ]; then
rustup component add rustfmt --toolchain "${TRAVIS_RUST_VERSION}${SMALLEST_COMPAT_RUST}"
fi
script:
- |
if [ -n "$BUILD_FMT" ]; then
cargo fmt --all -- --check
# rustfmt --check # With: `src/*.rs` xor `"$(find -name '*.rs' -not -path './target/*')"`
elif [ -n "$CLIPPY" ]; then
cargo clippy --all -- -D warnings
elif [ -n "$CARGO_TEST" ]; then
cargo test --all --features "$FEATURES"
fi
matrix:
include:
- rust: stable
env: BUILD_FMT=1
- rust: stable
env: CLIPPY=1
- rust: stable
env: CARGO_TEST=1
- stage: notify-website
env:
secure: 'o92El3sQPXbUKH2bW4wL2SMa7Kp7gJX43lOfO4nZD61zsOumPzRo8HaKCtheqlzLU30IhEeg/esoOYVzezv6GjH4alNV5qo5br8VqyCHbydlpDON1lvU4X1TRrySojPjfaR/r029PTJw1vfYcNxoNvvUbnzzEi4z9UiZ7l8ulIgqa7v8rzhC7LR2PwO9MJhvOzKfDHjEErF2r+NUifyL1IwtWTo0lMNUfKnrkgAnRX6KXR4Hn81xlNaeKyO+q7wlLfs9qmE7W/RhwtbNpypDZl0370sA7Sf7QUvZTgoVkcp0w1itmt6TxJpxOmNtP69OJM2SQRc4sqozJ9IGD5HcYi7kdvbtXHH/qtBvs7ufH95LIEVttxz2UB1ApK35/GWlymcypvBI+W888hO8EoX5UsRLVy6JUJ6Qumkr6v5NY1N/cETRL/fKR2kiZNw0IKeAPnPZAeqXiNSHe9Kye9LVo1Sb3/OQKoFQoeIuWczKNl4FTgcAO+CuAMadie8SB6Lt+t7pcEbQJetaHbPAWbyWRmZ8EqeCus+H1v+NffsIkPmKhfh+IWOTP15BE0EtEm0VT/0XOprmWsc9P8CozGgQy2mlnU0Kv95s14LakRsjRo9rXBZtRiqOo1lNJzWGopazSif+D3F966OyVyPwlRgYcPvkowh/ujLX2cDXJztGlyM='
script:
- email_author="$(git log -1 --pretty=format:'%an <%ce>')"
- author="${email_author% *}"; git config --global user.name "$author"
- email="${email_author#*<}"; email="${email::-1}"; git config --global user.email "$email"
- git clone https://SamuelMarks:[email protected]/Fantom-foundation/fantom-dev-web
&& cd fantom-dev-web
- echo " | [$TRAVIS_REPO_SLUG](https://github.com/$TRAVIS_REPO_SLUG) | [$TRAVIS_COMMIT_MESSAGE](https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT) |" >> CHANGESLOG.md
- git add CHANGESLOG.md
- git commit -m "[CHANGESLOG.md] $TRAVIS_REPO_SLUG - $TRAVIS_COMMIT_MESSAGE"
- git push -u origin master