sbt/scripts/travis.sh

94 lines
2.2 KiB
Bash
Raw Normal View History

2015-06-16 20:17:07 +02:00
#!/bin/bash
set -ev
TRAVIS_SCALA_VERSION="$1"
shift
TRAVIS_PULL_REQUEST="$1"
shift
TRAVIS_BRANCH="$1"
shift
PUBLISH="$1"
shift
2015-06-16 20:17:07 +02:00
function isNotPr() {
2015-06-16 20:17:07 +02:00
[ "$TRAVIS_PULL_REQUEST" = "false" ]
}
function publish() {
[ "$PUBLISH" = 1 ]
2015-06-16 20:17:07 +02:00
}
function isMaster() {
[ "$TRAVIS_BRANCH" = "master" ]
}
2015-06-18 01:00:03 +02:00
function isMasterOrDevelop() {
[ "$TRAVIS_BRANCH" = "master" -o "$TRAVIS_BRANCH" = "develop" ]
}
2015-07-07 20:43:18 +02:00
# Required for ~/.ivy2/local repo tests
~/sbt ++2.11.8 coreJVM/publishLocal http-server/publishLocal
2016-05-06 13:53:55 +02:00
# Required for HTTP authentication tests
./coursier launch \
io.get-coursier:http-server-java7_2.11:1.0.0-SNAPSHOT \
2016-05-06 13:53:55 +02:00
-r http://dl.bintray.com/scalaz/releases \
-- \
-d tests/jvm/src/test/resources/test-repo/http/abc.com \
-u user -P pass -r realm \
--list-pages \
2016-05-06 13:53:55 +02:00
-v &
2015-07-07 20:43:18 +02:00
# TODO Add coverage once https://github.com/scoverage/sbt-scoverage/issues/111 is fixed
2015-06-17 19:36:53 +02:00
SBT_COMMANDS="compile test it:test"
2016-04-06 22:38:10 +02:00
2017-01-31 15:23:03 +01:00
RUN_SHADING_TESTS=1
2017-01-30 22:57:24 +01:00
2016-04-06 22:38:10 +02:00
if echo "$TRAVIS_SCALA_VERSION" | grep -q "^2\.10"; then
SBT_COMMANDS="$SBT_COMMANDS publishLocal" # to make the scripted tests happy
2017-02-02 02:06:04 +01:00
SBT_COMMANDS="$SBT_COMMANDS sbt-coursier/scripted"
2017-01-30 22:57:24 +01:00
if [ "$RUN_SHADING_TESTS" = 1 ]; then
# for the shading scripted test
sudo cp coursier /usr/local/bin/
JARJAR_VERSION=1.0.1-coursier-SNAPSHOT
if [ ! -d "$HOME/.m2/repository/org/anarres/jarjar/jarjar-core/$JARJAR_VERSION" ]; then
git clone https://github.com/alexarchambault/jarjar.git
cd jarjar
if ! grep -q "^version=$JARJAR_VERSION\$" gradle.properties; then
echo "Expected jarjar version not found" 1>&2
exit 1
fi
git checkout 249c8dbb970f8
./gradlew :jarjar-core:install
cd ..
rm -rf jarjar
fi
2017-02-02 02:06:04 +01:00
SBT_COMMANDS="$SBT_COMMANDS sbt-coursier/publishLocal sbt-shading/scripted"
2017-01-30 22:57:24 +01:00
fi
2016-04-06 22:38:10 +02:00
fi
2016-07-24 14:32:36 +02:00
SBT_COMMANDS="$SBT_COMMANDS tut coreJVM/mimaReportBinaryIssues cache/mimaReportBinaryIssues"
2016-04-06 22:38:10 +02:00
2016-11-27 13:44:14 +01:00
~/sbt ++${TRAVIS_SCALA_VERSION} $SBT_COMMANDS
2017-02-21 15:57:42 +01:00
scripts/java-6-test.sh
2016-11-27 13:44:14 +01:00
if isNotPr && publish && isMaster; then
2016-11-27 13:44:14 +01:00
~/sbt ++${TRAVIS_SCALA_VERSION} publish
2015-06-16 20:17:07 +02:00
fi
2015-06-17 19:36:53 +02:00
2015-12-31 01:34:11 +01:00
PUSH_GHPAGES=0
if isNotPr && publish && isMasterOrDevelop; then
2015-06-18 01:00:03 +02:00
if echo "$TRAVIS_SCALA_VERSION" | grep -q "^2\.11"; then
PUSH_GHPAGES=1
fi
fi
# [ "$PUSH_GHPAGES" = 0 ] || "$(dirname "$0")/push-gh-pages.sh" "$TRAVIS_SCALA_VERSION"