Skip to content

Commit 957e59c

Browse files
authored
Merge pull request #19 from lrytz/merge-2.12
Merge 2.12
2 parents ea2696b + aa0904f commit 957e59c

File tree

3 files changed

+87
-3
lines changed

3 files changed

+87
-3
lines changed

Diff for: .travis.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: scala
2+
3+
jdk: oraclejdk8
4+
5+
env:
6+
global:
7+
# GITHUB_OAUTH_TOKEN (for GitHub user scala-jenkins, same token as scabot)
8+
secure: "ErMvEJv2oDyQqclA0IM78thPkZG+0kjBSIKbDtI/PIoaoxMKi+gtsYH92/JFU26oNfDwgqh3B0QwU2niyK3TO0P0xjmrYsvlMXjDwgHX/w+hw7GuIXUp4r8/V1nyNF+9OGlHtNbtbDtFilThI2osS+/G304cNsE4GVa9LRxhzpQ="
9+
10+
script:
11+
- source scripts/common
12+
- if [[ "$scala_sha" != "" ]]; then postCommitStatus "pending"; fi
13+
- scripts/jobs/release/smoketest
14+
15+
after_script:
16+
- |
17+
if [[ "$scala_sha" != "" ]]; then
18+
if [[ "$TRAVIS_TEST_RESULT" == "0" ]]; then
19+
local state="success"
20+
else
21+
local state="failure"
22+
fi
23+
postCommitStatus $state
24+
fi
25+
26+
cache:
27+
directories:
28+
- $HOME/.ivy2/cache
29+
- $HOME/.sbt
30+
before_cache:
31+
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
32+
- find $HOME/.sbt -name "*.lock" -print -delete

Diff for: scripts/common

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# https://github.com/travis-ci/docs-travis-ci-com/issues/949
2+
function travis_fold_start() {
3+
echo ""
4+
echo -e "travis_fold:start:$1\033[33;1m$2\033[0m"
5+
}
6+
7+
function travis_fold_end() {
8+
echo -e "\ntravis_fold:end:$1\r"
9+
echo ""
10+
}
11+
12+
# Params:
13+
# - state: pending / success / failed / error
14+
function postCommitStatus() {
15+
local jsonTemplate='{ "state": "%s", "target_url": "%s", "description": "%s", "context": "%s"}'
16+
local json=$(printf "$jsonTemplate" "$1" "https://travis-ci.org/scala/scala-dist-smoketest/builds/$TRAVIS_BUILD_ID" "$1" "travis/scala-dist-smoketest/$version")
17+
18+
local curlStatus=$(curl \
19+
-s -o /dev/null -w "%{http_code}" \
20+
-H "Accept: application/vnd.github.v3+json" \
21+
-H "Authorization: token $GITHUB_OAUTH_TOKEN" \
22+
-d "$json" \
23+
https://api.github.com/repos/scala/scala/statuses/$scala_sha)
24+
25+
[[ "$curlStatus" == "201" ]] || {
26+
echo "Failed to publish GitHub commit status"
27+
exit 1
28+
}
29+
}

Diff for: scripts/jobs/release/smoketest

+26-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
#!/bin/bash -ex
22

3-
# This script requires sbtDistVersionOverride=-Dproject.version=...
3+
function ensureVersion() {
4+
local verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
5+
[[ "$version" =~ $verPat ]] || {
6+
echo "Not a valid Scala version: '$version'"
7+
exit 1
8+
}
9+
}
10+
11+
clearIvyCache() {
12+
rm -fv $HOME/.ivy2/exclude_classifiers $HOME/.ivy2/exclude_classifiers.lock
13+
rm -rfv $HOME/.ivy2/cache/org.scala-lang $HOME/.ivy2/cache/org.scala-lang.modules
14+
rm -rfv $HOME/.ivy2/local/org.scala-lang $HOME/.ivy2/local/org.scala-lang.modules
15+
if [ -d $HOME/.ivy2 ]; then find $HOME/.ivy2 -name "*compiler-interface*$version*" | xargs rm -rfv; fi
16+
if [ -d $HOME/.sbt ]; then find $HOME/.sbt -name "*compiler-interface*$version*" | xargs rm -rfv; fi
17+
}
18+
19+
if [[ "$TRAVIS_EVENT_TYPE" == "api" ]]; then
20+
ensureVersion
21+
else
22+
# Use some recent version to validate changes in smoketest itself
23+
version="2.12.4"
24+
fi
25+
26+
clearIvyCache
427

5-
rm -rf $WORKSPACE/ivy2
28+
sbtDistVersionOverride="-Dproject.version=$version"
629

730
integrationRepoUrl=${integrationRepoUrl-"https://scala-ci.typesafe.com/artifactory/scala-integration/"}
831

9-
sbt -Dsbt.log.noformat=true -Dsbt.ivy.home=$WORKSPACE/ivy2 \
32+
sbt -Dsbt.log.noformat=true \
1033
"set resolvers += \"scala-integration\" at \"$integrationRepoUrl\"" \
1134
$sbtDistVersionOverride \
1235
clean run

0 commit comments

Comments
 (0)