This repository has been archived by the owner on May 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from media-cloud-ai/dev/add_travis_ci
Add Travis CI
- Loading branch information
Showing
4 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
language: rust | ||
|
||
os: linux | ||
|
||
rust: | ||
- 1.36.0 | ||
- 1.37.0 | ||
- 1.38.0 | ||
- 1.39.0 | ||
- stable | ||
- beta | ||
- nightly | ||
|
||
env: | ||
- WORKER_LIBRARY_FILE=$TRAVIS_BUILD_DIR/libworker.so | ||
|
||
jobs: | ||
allow_failures: | ||
- rust: nightly | ||
include: | ||
# Rustfmt | ||
- rust: stable | ||
install: | ||
- rustup component add rustfmt-preview | ||
before_script: | ||
- cargo fmt --version | ||
script: | ||
- cargo fmt -- --check | ||
|
||
# Clippy | ||
- rust: stable | ||
install: | ||
- rustup component add clippy-preview | ||
script: | ||
# Fail if clippy output contains "error:" or "warning:" | ||
- cargo clippy 2>&1 | tee ./clippy.out && ! grep -qe "error:\|warning:" ./clippy.out | ||
|
||
# Test coverage (with Tarpaulin) | ||
- rust: stable | ||
install: | ||
- RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin --force | ||
script: | ||
- gcc -c -Wall -Werror -fpic worker.cpp && gcc -shared -o libworker.so worker.o | ||
- cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID | ||
|
||
script: | ||
- gcc -c -Wall -Werror -fpic worker.cpp && gcc -shared -o libworker.so worker.o | ||
- cargo test | ||
cache: | ||
cargo: true | ||
before_cache: | ||
# Travis can't cache files that are not readable by "others" | ||
- chmod -R a+r $HOME/.cargo | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- libssl-dev # Required for tarpaulin | ||
- gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters