-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multiple build targets to verify compilation across architectures (…
…#61) * Add multiple build targets * Move shell script logic to separate file and out of travis.yml
- Loading branch information
1 parent
bf11975
commit 673f86e
Showing
3 changed files
with
70 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -x | ||
|
||
# If no target specified, run a normal cargo build and format check | ||
if [ -z "${TARGET}" ]; then | ||
cargo build --verbose | ||
cargo fmt -- --check | ||
# Cross doesn't have support for ios targets, so manually add/build them with cargo | ||
elif [ "$IOS" = 1 ]; then | ||
rustup target add "$TARGET" | ||
cargo build --target "$TARGET" | ||
# Otherwise use cross to build for the specified argument | ||
else | ||
cross build --target "$TARGET" | ||
fi | ||
|
||
# Only run unit tests if architecture specifies that we should | ||
if [ "$TEST" = 1 ]; then | ||
if [ -z "${TARGET}" ]; then | ||
cargo test --verbose | ||
else | ||
cross test --target "$TARGET" | ||
fi | ||
fi |