forked from casbin/casbin-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
49 lines (47 loc) · 1.55 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
language: rust
sudo: required
dist: trusty
addons:
apt:
packages:
- libssl-dev
cache: cargo
rust:
- stable
- nightly
matrix:
allow_failures:
- rust: nightly
before_script:
- rustup component add rustfmt
- rustup component add clippy
script:
- cargo clean
- cargo build
# Todo: https://github.com/rust-lang/cargo/issues/2980
- cargo test --no-default-features --features runtime-async-std,logging
- cargo test --no-default-features --features runtime-tokio,logging
- cargo clippy -- -D warnings
- cargo fmt --all -- --check
after_success: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
# upload report to codecov
docker run --security-opt seccomp=unconfined -v "$PWD:/volume" xd009642/tarpaulin sh -c "cargo tarpaulin --out Xml"
bash <(curl -s https://codecov.io/bash)
if [[ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" != "master" ]] && [[ "$TRAVIS_PULL_REQUEST" != false ]]; then
REMOTE_URL="$(git config --get remote.origin.url)";
# Clone the repository fresh..for some reason checking out master fails
# from a normal PR build's provided directory
cd ${TRAVIS_BUILD_DIR}/.. && \
git clone ${REMOTE_URL} "${TRAVIS_REPO_SLUG}-bench" && \
cd "${TRAVIS_REPO_SLUG}-bench" && \
git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge
# Bench master
cargo bench -- --save-baseline before && \
# Bench PR
git checkout FETCH_HEAD && \
cargo bench -- --save-baseline after && \
cargo install critcmp --force && \
critcmp before after
fi
fi