2016-12-16 18:45:58 +00:00
|
|
|
language: rust
|
2018-06-14 20:23:17 +00:00
|
|
|
# We use OSX so that we can get a reasonably up to date version of SQLCipher.
|
|
|
|
# (The version in Travis's default Ubuntu Trusty is much too old).
|
|
|
|
os: osx
|
|
|
|
before_install:
|
|
|
|
- brew install sqlcipher --with-fts
|
2018-08-22 10:55:21 +00:00
|
|
|
env:
|
|
|
|
- MENTAT_RUST_VERSION=1.25.0 # Must align with `build/version.rs`.
|
2018-06-13 16:35:41 +00:00
|
|
|
rust:
|
2018-08-22 10:55:21 +00:00
|
|
|
- 1.25.0
|
2018-06-13 16:35:41 +00:00
|
|
|
- stable
|
|
|
|
- beta
|
|
|
|
- nightly
|
|
|
|
matrix:
|
|
|
|
allow_failures:
|
|
|
|
- rust: nightly
|
|
|
|
fast_finish: true
|
2018-08-08 16:40:18 +00:00
|
|
|
install:
|
|
|
|
- |
|
2018-08-22 10:55:21 +00:00
|
|
|
if [[ "$TRAVIS_RUST_VERSION" = "$MENTAT_RUST_VERSION" ]]; then
|
2018-08-08 16:40:18 +00:00
|
|
|
rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios x86_64-apple-ios i386-apple-ios &&
|
2018-08-22 10:55:21 +00:00
|
|
|
# The version of cargo-lipo in Crates.io doesn't contain any support for Cargo manifests in subdirectories and the build fail.
|
|
|
|
# We therefore need to use a Beta version that contains the right code.
|
|
|
|
cargo install --git https://github.com/TimNN/cargo-lipo --rev d347567ff337ee169ba46a624229a451dd6f6067 &&
|
|
|
|
# If we don't list the devices available then, when we come to pick one during the test run, Travis doesn't
|
|
|
|
# think that there are any devices available and the build fails.
|
2018-08-08 16:40:18 +00:00
|
|
|
# TODO: See if there is a less time consuming way of doing this.
|
|
|
|
instruments -s devices
|
|
|
|
fi
|
2016-12-16 22:26:10 +00:00
|
|
|
script:
|
2017-02-20 18:58:56 +00:00
|
|
|
- cargo test --verbose --all
|
2018-07-19 17:03:19 +00:00
|
|
|
- cargo test --features edn/serde_support --verbose --all
|
2018-06-14 20:23:17 +00:00
|
|
|
# We can't pick individual features out with `cargo test --all` (At the time of this writing, this
|
2018-06-14 20:30:03 +00:00
|
|
|
# works but does the wrong thing because of a bug in cargo, but its fix will be to disallow doing
|
2018-06-14 20:23:17 +00:00
|
|
|
# this all-together, see https://github.com/rust-lang/cargo/issues/5364 for more information). To
|
|
|
|
# work around this, we run individual tests for each subcrate individually.
|
|
|
|
- |
|
|
|
|
for manifest in $(find . -type f -name Cargo.toml); do
|
|
|
|
cargo test --manifest-path $manifest --verbose --no-default-features --features sqlcipher
|
|
|
|
done
|
2018-08-08 16:40:18 +00:00
|
|
|
- |
|
2018-08-22 10:55:21 +00:00
|
|
|
if [[ "$TRAVIS_RUST_VERSION" = "$MENTAT_RUST_VERSION" ]]; then
|
|
|
|
pushd ffi &&
|
2018-08-08 16:40:18 +00:00
|
|
|
cargo lipo --release &&
|
2018-08-22 10:55:21 +00:00
|
|
|
popd &&
|
|
|
|
pushd sdks/swift/Mentat &&
|
2018-08-08 16:40:18 +00:00
|
|
|
xcodebuild -configuration Debug -scheme "Mentat Debug" -sdk iphonesimulator test -destination 'platform=iOS Simulator,name=iPhone X,OS=11.4' &&
|
2018-08-22 10:55:21 +00:00
|
|
|
popd
|
2018-08-08 16:40:18 +00:00
|
|
|
fi
|
2018-07-19 16:32:54 +00:00
|
|
|
after_success:
|
|
|
|
- |
|
|
|
|
if [[ "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" ]]; then
|
|
|
|
cargo doc &&
|
|
|
|
echo "<meta http-equiv=refresh content=0;url=mentat/index.html>" > target/doc/index.html &&
|
|
|
|
git clone https://github.com/davisp/ghp-import.git &&
|
|
|
|
./ghp-import/ghp_import.py -n -p -f -r https://"$GH_TOKEN"@github.com/"$TRAVIS_REPO_SLUG.git" target/doc
|
|
|
|
fi
|
2018-06-13 16:35:41 +00:00
|
|
|
cache: cargo
|