Skip to content

Commit 1cc41e4

Browse files
committed
Update Travis build script
- Use `swift package clean` instead of the deprecated `swift build --clean` - Run Swift Package Manager tests in parallel - Print version and debug information before running - Cleanup
1 parent 6b5f8cd commit 1cc41e4

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

scripts/travis-build-script.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@
44
# <https://travis-ci.org/>. Supports testing Swift Package Manager
55
# packages on macOS and Linux.
66

7+
set -ue -o pipefail
8+
79
echo "Running on OS: ${TRAVIS_OS_NAME}"
810

911
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
1012
# macOS
1113
# 1. Test using Swift Package Manager
12-
swift build --clean
14+
swift --version
15+
swift package clean
1316
swift build
14-
swift test
17+
swift test --parallel
1518

1619
# 2. Test using xcodebuild
17-
set -o pipefail
20+
xcodebuild -version
21+
xcodebuild -showsdks
22+
instruments -s devices
1823
xcodebuild test -scheme SortedArray-macOS | xcpretty
1924
xcodebuild test -scheme SortedArray-iOS -destination "platform=iOS Simulator,name=iPhone 7,OS=10.1" | xcpretty
2025
xcodebuild test -scheme SortedArray-tvOS -destination "platform=tvOS Simulator,name=Apple TV 1080p" | xcpretty
@@ -25,9 +30,9 @@ elif [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
2530
echo "Using Docker image: ${DOCKER_IMAGE}"
2631
# Download the Docker container. This is not strictly necessary since
2732
# docker run would automatically download a missing container.
28-
docker pull ${DOCKER_IMAGE}
33+
docker pull "${DOCKER_IMAGE}"
2934
# Share the current directory (where Travis checked out the repository)
3035
# with the Docker container.
3136
# Then, in the container, cd into that directory and run the tests.
32-
docker run --volume "$(pwd):/root/repo" ${DOCKER_IMAGE} /bin/bash -c "cd /root/repo; swift build --clean; swift build; swift test"
37+
docker run --volume "$(pwd):/package" "${DOCKER_IMAGE}" /bin/bash -c "cd /package; swift --version; swift package clean; swift build; swift test --parallel"
3338
fi

0 commit comments

Comments
 (0)