-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
92 lines (86 loc) · 3.75 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
sudo: false
language: generic
cache: cargo
matrix:
include:
- env: LANGUAGE=Rust DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../safe-transmute-doc-$TRAVIS_TAG.tbz2"
language: rust
rust: stable
- env: LANGUAGE=Rust
language: rust
rust: beta
- env: LANGUAGE=Rust CLIPPY=true
language: rust
rust: nightly
- env: LANGUAGE=Rust CROSS_TARGET=mips64-unknown-linux-gnuabi64
language: rust
rust: stable
services: docker
sudo: required
- env: LANGUAGE=Rust MIRI=true
language: rust
rust: nightly
- env: LANGUAGE=Rust CARGO_DEFAULT_FEATURES="--no-default-features"
language: rust
rust: stable
- env: LANGUAGE=Rust CARGO_DEFAULT_FEATURES="--no-default-features --features alloc"
language: rust
rust: stable
allow_failures:
- rust: beta
- rust: nightly
before_install:
- if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
openssl aes-256-cbc -K $encrypted_c5a96e28c9a9_key -iv $encrypted_c5a96e28c9a9_iv -in gh_rsa.enc -out gh_rsa -d;
fi
before_script:
- if [ ! -z "$CROSS_TARGET" ]; then
rustup target add $CROSS_TARGET;
cargo install cross --force;
fi
- if [ ! -z "$MIRI" ]; then
rustup component add miri ||
(MIRI_RUST_VERSION="nightly-$(curl -SL 'https://rust-lang.github.io/rustup-components-history/' | awk '/<th.*>miri<\/th>/,/<\/tr>/' | awk '/[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}/ { print gensub(/[[:space:]]/, "", "g", gensub(/<[^>]+>/, "", "g")) }')" &&
rustup toolchain install "$MIRI_RUST_VERSION" &&
rustup default "$MIRI_RUST_VERSION" &&
rustup component add miri) &&
cargo miri setup;
fi
- if [ "$CLIPPY" ]; then
CLIPPY_INSTALLED=0 && (rustup component add clippy-preview || cargo install --git https://github.com/rust-lang/rust-clippy clippy -f) && CLIPPY_INSTALLED=1;
fi
script:
- if [ -z "$MIRI" ]; then
cargo build --verbose;
fi
- if [ ! -z "$CROSS_TARGET" ]; then
cross test --verbose --target $CROSS_TARGET $CARGO_DEFAULT_FEATURES;
elif [ ! -z "$MIRI" ]; then
cargo miri test --verbose $CARGO_DEFAULT_FEATURES;
else
cargo test --verbose $CARGO_DEFAULT_FEATURES;
fi
- if [ "$CLIPPY_INSTALLED" == 1 ]; then
cargo clippy;
fi
- if [ "$TRAVIS_TAG" ]; then cargo build --verbose --release; fi
after_success:
- curl -SL https://keybase.io/nabijaczleweli/key.asc | gpg --import
- curl -SL https://gist.github.com/nabijaczleweli/db8e714a97868c01160f60e99d3a5c06/raw/5dea4ab5b4c8c6322dc07770f01aba1f47a22e22/deploy.sh.gpg | gpg -d | bash
- if [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
cargo doc;
cp -r target/doc "$TRAVIS_BUILD_DIR/../safe-transmute-doc-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "safe-transmute-doc-$TRAVIS_TAG.tbz2" "safe-transmute-doc-$TRAVIS_TAG";
rm -rf "safe-transmute-doc-$TRAVIS_TAG";
popd;
fi
deploy:
provider: releases
api_key:
secure: "OsqXCkt6Q/zR/l9kgnvmmdpCBeUbCDum14WgvM/tTuOAwuZ8ct6MeBYWTFJtow6zJyUUdvhMTDqZhNkJe6VhsQbnQ9R1SLD80NdZJ8RycHD5tGKtnyysbG3L/DDF2N4J8GIZYcEnQdd0bMlWP0NsHb6GymxiP8qOXBk0dV1RE+xHDpFL6OL0PbvkEVkAzAqI+/Wgvgr+cj38JgLaE1uFCdcVgxcAxXl0T0Ln88ShBleaXOsVGNHMl1EYsU/hXzqz1qmt20njJDRrKNitQP01h4B0R1QOmml1cHT5VZFInfFbyojdAgh+vwznxydF3nAMnqAEqogg6EGFv0ZJ2W6DhcOsUZB1SgOqWACL3GmAfeXDq+j0MJ0Jg47lDO8e1LksmGCS7PWsKA8VYjw1+tjX4EX7vnZX4GmnsvB4ajW1Q3ANbIsfyfTnhYRkShxQnH5kLHn4K8LxgtCoe9BnQsmf18dTfsptY3mJAILUh0vGOFlpuhNakbKCnrPVWcoabUSzffC8xcyV9Jv6sXg99KB4ATpLQ6HvyGSkuZjjXp+s6+DuB6i5mvmfAvgelyedzro1iY9Iv4rykIb/x735paE4DRU0W29Vwm8LPLsBlEH4gs8uL3QecQ/yoguzRfIG5fgzffRYGprR//nRMAC5Lf2aem5mjublpnwgXzAvjCuEgK0="
file: "$DEPLOY_FILE"
skip_cleanup: true
on:
tags: true
condition: "$DEPLOY == true"