This repository has been archived by the owner on Mar 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy path.travis.yml
94 lines (94 loc) · 3.2 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
93
94
vars:
env:
global:
- RUST_BACKTRACE=1
- PATH=$PATH:$HOME/.cargo/bin
language: rust
addons:
apt:
packages: &DEFAULT_PACKAGES
- desktop-file-utils
- xdg-utils
- links
matrix:
include:
- os: linux
rust: stable
- os: linux
rust: stable-i686-unknown-linux-gnu
addons:
apt:
packages:
- *DEFAULT_PACKAGES
- gcc-multilib
- os: osx
rust: stable
sudo: false
branches:
only:
- master
cache:
cargo: true
before_script:
# Expected version change PR title format:
# Version change to 0.2.2;
- if [[ $TRAVIS_COMMIT_MESSAGE =~ [Vv]ersion[[:space:]]change[[:space:]]to[[:space:]]([^;]+) ]]; then
VERSION=v$(cargo pkgid | sed -e "s/.*[:#]\(.*\)/\1/");
if [[ "v${BASH_REMATCH[1]}" != $VERSION ]]; then
echo "Version mismatch between commit message and Cargo.toml.";
false;
fi;
else
VERSION=${TRAVIS_COMMIT:0:7};
fi
- curl -sSL https://github.com/maidsafe/QA/raw/master/travis/cargo_install.sh > cargo_install.sh
- bash cargo_install.sh cargo-prune;
- rustup component add rustfmt;
- rustup component add clippy;
script:
- if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then
cargo fmt -- --check &&
cargo test --release --verbose -- --test-threads=1 &&
cargo check &&
cargo clippy &&
cargo clippy --profile=test;
fi
after_script:
- if [[ $TRAVIS_EVENT_TYPE = pull_request && -n $(git diff --shortstat 2> /dev/null | tail -n1) ]]; then
echo "Working tree is dirty after building. Probably Cargo.lock should be updated.";
git status;
travis_terminate 1;
fi
before_cache:
- cargo prune
before_deploy:
- mkdir -p target/deploy
- if [[ $TRAVIS_RUST_VERSION =~ i686 ]]; then
ARCH=x86;
else
ARCH=x64;
fi
# We need to use `-x` on OS X since `strip` fails to remove global symbols from release builds on OS X.
- if [[ $TRAVIS_OS_NAME = linux ]]; then
SUFFIX=so;
else
SUFFIX=dylib STRIP_ARG=-x;
fi
- cargo build --verbose --release
- strip $STRIP_ARG target/release/libsystem_uri.$SUFFIX
- zip -j target/deploy/system_uri-$VERSION-$TRAVIS_OS_NAME-$ARCH.zip target/release/libsystem_uri.$SUFFIX
deploy:
provider: s3
access_key_id: AKIAIA2TXTG7EV5VIG2Q
secret_access_key:
secure: oB2nIP+2baRYpfRonODxqJk9a9ULX+0JHSmBBRiN4PuXk9GpPZhiV16rbXPQUVTgooo1Y6hoGQZda9cMUrB6YtXqSUXmWwzV0RwWqH8U5nQQBjEG50xhYcnwsf4yO9OLdnjsczK9FYoTgrSAdaqnVisLN3VmbhcYRtvaqq/pCAcHe0koyGC/52Vy2nzMZGl/MZNWUtce0rn1cUg0ns8Frs20N8KedGTOSQpQ3ZZ1TJTgns+Z2uVo9BfbstdSWnkRCLDJjVf4vorkPnaKRACgIn2jX88Gc7y/kqxk7HiOT8GdF9G4V53Lkgq+RWEvmOnjPQwL+pHRHJ7NmE24Ez+GuVkDSkFXzobxoMfrjBOSVN8a/eluWGKRtyohCGiPVWEX+4YzptnXQLNOo2gL3UAqouBSEFYI6JD5LxZRM/z/E6slsBwIoUaqGnsQOfLUclc9saeCvt19q8yUj6fdEx8S9mazic83biFDM20iZh+Ypwcx4OPigTRhdpt1tdxz7zheFkVHa0SJNfgF65OFcocq2WNVkaoxNNKdZNOvyI8hKdiaqdf1EgP2sRhYgvqxF8XHadjQ8s0QIwD7A+zvX6qfo9GRPrro27HTOZLX2g23t599I7bdIs4I9npatC7fJsah73gMdDCeSSV9idnWnuefk3sgz5prXv+f5MbwT4cK0Ec=
bucket: system-uri
local-dir: target/deploy
acl: public_read
region: eu-west-2
skip_cleanup: true
on:
branch: master
tags: false
condition: $TRAVIS_EVENT_TYPE = push
after_deploy: rm -rf target/deploy