Files
chatmail-core/ci/run.sh
Friedel Ziegelmayer 0d51c7dd2e Prepare for android builds (#88)
* upgrade ci

* fixup

* update ci script

* Update run.sh

* refactor(time): drop libc time functions

* fix(ffi): use i64 instead off time_t

* fix(ci): install croos

* fix: remove unused dc_check_password

* fix(ffi): enable ssl vendoring by default

* chore: remove unused import

* fix(deps): add vendored flag for reqwest

* chore(ci): use cross fork

* fix: handle invalid  server configurations

Closes #90

* Disable android from circle ci for now
2019-05-28 17:41:50 +02:00

45 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -ex
export RUST_TEST_THREADS=1
export RUST_BACKTRACE=1
export OPT="--target=$TARGET"
export OPT_RELEASE="--release ${OPT}"
export OPT_FFI_RELEASE="--manifest-path=deltachat-ffi/Cargo.toml --release"
# Select cargo command: use cross by default
export CARGO_CMD=cross
# On Appveyor (windows) and Travis (x86_64-unknown-linux-gnu and apple) native targets we use cargo (no need to cross-compile):
if [[ $TARGET = *"windows"* ]] || [[ $TARGET == "x86_64-unknown-linux-gnu" ]] || [[ $TARGET = *"apple"* ]]; then
export CARGO_CMD=cargo
fi
# Install cross if necessary:
if [[ $CARGO_CMD == "cross" ]]; then
cargo install --git https://github.com/dignifiedquire/cross --rev fix-tty --force
fi
# Make sure TARGET is installed when using cargo:
if [[ $CARGO_CMD == "cargo" ]]; then
rustup target add $TARGET || true
fi
# If the build should not run tests, just check that the code builds:
if [[ $NORUN == "1" ]]; then
export CARGO_SUBCMD="build"
else
export CARGO_SUBCMD="test"
export OPT="${OPT} "
export OPT_RELEASE="${OPT_RELEASE} "
fi
# Run all the test configurations:
$CARGO_CMD $CARGO_SUBCMD $OPT
$CARGO_CMD $CARGO_SUBCMD $OPT_RELEASE
$CARGO_CMD $CARGO_SUBCMD $OPT_RELEASE_IGNORED
# Build the ffi lib
$CARGO_CMD $CARGO_SUBCMD $OPT_FFI_RELEASE