-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 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 |
---|---|---|
|
@@ -9,3 +9,6 @@ lib-lint: | |
|
||
pod-release: | ||
bundle exec pod trunk push | ||
|
||
test-linux: | ||
sh scripts/test-linux.sh |
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,34 @@ | ||
# !/bin/bash | ||
|
||
set -e | ||
|
||
if [[ `uname` == "Darwin" ]]; then | ||
if [[ -z `which docker-machine 2>/dev/null` || -z `which virtualbox 2>/dev/null` ]] ; then | ||
echo "Install docker-machine and virtualbox ahead." | ||
exit -1 | ||
fi | ||
|
||
if [[ ! $(docker info 2>/dev/null) ]]; then | ||
echo "Is Docker running?" | ||
exit -1 | ||
fi | ||
|
||
DOCKER_HOST_NAME=com.ryo.DifferenceKit.test | ||
WORKING_DIR=$(pwd) | ||
|
||
echo "Starting to running tests on Linux by Docker..." | ||
docker-machine create --driver virtualbox $DOCKER_HOST_NAME || true | ||
docker run -v $WORKING_DIR:$WORKING_DIR -w $WORKING_DIR -it --privileged swift:latest bash -c "$0" || true | ||
docker-machine stop $DOCKER_HOST_NAME || true | ||
docker-machine rm -f $DOCKER_HOST_NAME || true | ||
echo "Finish" | ||
|
||
elif [[ `uname` == "Linux" ]]; then | ||
swift build | ||
swift test | ||
|
||
else | ||
echo "Unsupported OS (`uname`)" | ||
exit -1 | ||
|
||
fi |