Skip to content

Commit e3b2ae9

Browse files
committed
use Travis for (vastly simpler) PR validation
use only sbt, avoid using external shell scripts and environment variables. we just need a few simple commands right here in .travis.yml doesn't publish anything to Artifactory. let's discuss the way forward on that at scala/scala-dev#507
1 parent 534a929 commit e3b2ae9

File tree

2 files changed

+36
-61
lines changed

2 files changed

+36
-61
lines changed

.travis.yml

+25-53
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,30 @@
1-
sudo: required # GCE VMs have better performance (will be upgrading to premium VMs soon)
1+
# GCE VMs have better performance (will be upgrading to premium VMs soon)
2+
sudo: required
23

34
language: scala
45
jdk: openjdk8
56

6-
77
cache:
88
directories:
99
- $HOME/.ivy2/cache
1010
- $HOME/.sbt
11-
- build/
12-
13-
14-
before_script:
15-
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then (cd admin && ./init.sh); fi'
1611

1712
stages:
18-
- name: build # also builds the spec using jekyll
19-
# tests are running into time limits (will re-enable once Jason's partest speedups are in)
20-
- name: test
21-
if: env(bla) = thisVarIsNotSet AND type != pull_request # just disabling tests for now, but commenting the stage here doesn't do the trick
22-
- name: publish
23-
if: type != pull_request
13+
- name: build
2414

25-
# see comment in `bootstrap_fun` for details on the procedure
26-
# env available in each stage
27-
# - by travis config (see below): secret env vars
28-
# - by `common` script: WORKSPACE, IVY2_DIR, SBT_CMD, integrationRepoUrl
29-
# - by `bootstrap_fun`: publishPrivateTask, ...
30-
# env computed in first stage, passed on to later stages with the `build/env` file
31-
# - by `determineScalaVersion`: SCALA_VER, publishToSonatype
32-
# - by `buildModules` / `constructUpdatedModuleVersions`: updatedModuleVersions
3315
jobs:
3416
include:
17+
18+
# full bootstrap and publish
3519
- stage: build
36-
# currently, not touching PR validation
37-
# (also, we couldn't even, because the password to publish to artifactory is not there :-/)
3820
if: type != pull_request
3921
script:
22+
# see comment in `bootstrap_fun` for details on the procedure
23+
# env available in each stage
24+
# - by travis config (see below): secret env vars
25+
# - by `common` script: WORKSPACE, IVY2_DIR, SBT_CMD, integrationRepoUrl
26+
# - by `bootstrap_fun`: publishPrivateTask, ...
27+
- (cd admin && ./init.sh)
4028
- source scripts/common
4129
- source scripts/bootstrap_fun
4230
- determineScalaVersion
@@ -45,38 +33,26 @@ jobs:
4533
- if [ ! -z "$STARR_REF" ]; then buildStarr; fi
4634
- buildLocker
4735
- buildQuick
48-
- set | grep -E '^SCALA_VER=|^SCALA_BINARY_VER=|^XML_VER=|^PARTEST_VER=|^SCALACHECK_VER=|^XML_BUILT=|^PARTEST_BUILT=|^SCALACHECK_BUILT=|^updatedModuleVersions=|^publishToSonatype=' > build/env
49-
- cat build/env
5036
- triggerScalaDist
5137

52-
# this builds the spec using jekyll
53-
# based on http://www.paperplanes.de/2013/8/13/deploying-your-jekyll-blog-to-s3-with-travis-ci.html
38+
# pull request validation (w/ mini-bootstrap)
39+
- stage: build
40+
if: type = pull_request
41+
script:
42+
- sbt -warn setupPublishCore generateBuildCharacterPropertiesFile publishLocal
43+
- STARR=`cat buildcharacter.properties | grep ^maven.version.number | cut -d= -f2` && echo $STARR
44+
- sbt -Dstarr.version=$STARR -warn setupValidateTest test:compile info testAll
45+
46+
# build the spec using jekyll
5447
- stage: build
55-
script: bundle exec jekyll build -s spec/ -d build/spec
5648
rvm: 2.2
5749
install: bundle install
58-
# the key is restricted using forced commands so that it can only upload to the directory we need here
59-
after_success: ./scripts/travis-publish-spec.sh
60-
61-
# be careful to not set any env vars, as this will result in a cache miss
62-
- &test
63-
stage: test
64-
before_script:
65-
- source build/env
66-
- if [ -z "$SCALA_VER" ]; then echo "Environment not propagated. Caching issue?"; cat build/env ; exit 1; fi
67-
- source scripts/common
68-
- source scripts/bootstrap_fun
69-
# - find build -type f -exec touch {} + # "set antStyle := true" seems to cause really long compiles for the test suite??
70-
script: invokeQuick testRest # shouldn't rebuild, since build/ is cached
71-
- <<: *test
72-
script: invokeQuick testPosPres
73-
- <<: *test
74-
script: invokeQuick testRun
75-
- script: testStability
50+
script:
51+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then (cd admin && ./init.sh); fi'
52+
- bundle exec jekyll build -s spec/ -d build/spec
53+
after_success:
54+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then ./scripts/travis-publish-spec.sh; fi'
7655

77-
# cat /dev/urandom | head -c 10000 | openssl sha1 > ./secret
78-
# openssl aes-256-cbc -pass "file:./secret" -in id_dsa_spec212_b4096 -out spec/id_dsa_travis.enc -a
79-
# travis encrypt "PRIV_KEY_SECRET=`cat ./secret`"
8056
env:
8157
global:
8258
- secure: "TuJOUtALynPd+MV1AuMeIpVb8BUBHr7Ul7FS48XhS2PyuTRpEBkSWybYcNg3AXyzmWDAuOjUxbaNMQBvP8vvehTbIYls5H5wTGKvj0D0TNVaPIXjF8bA8KyNat9xGNzhnWm2/2BMaWpKBJWRF7Jb+zHhijMYCJEbkMtoiE5R/mY=" # PRIV_KEY_SECRET, for scripts/travis-publish-spec.sh
@@ -86,10 +62,6 @@ env:
8662
- secure: "dbAvl6KEuLwZ0MVQPZihFsPzCdiLbX0EFk3so+hcfEbksrmLQ1tn4X5ZM7Wy1UDR8uN9lxngEwHch7a7lKqpugzmXMew9Wnikr9WBWbJT77Z+XJ/jHI6YuiCRpRo+nvxXGp9Ry80tSIgx5eju0J83IaJL41BWlBkvyAd7YAHORI=" # GPG_SUBKEY_SECRET
8763
- secure: "ee0z/1jehBjFa2M2JlBHRjeo6OEn/zmVl72ukBP1ISeKqz18Cswc4gDI5tV9RW9SlYFLkIlGsR2qnRCyJ/pqgQLcNdrpsCRFFc79oyLhfEtmPdAHlWfj4RSP68zINRtDdFuJ8iSy8XYP0NaqpVIYpkNdv9I6q7N85ljmMQpHO+U=" # TRAVIS_TOKEN (login with GitHub as lrytz)
8864

89-
90-
# using S3 would be simpler, but we want to upload to scala-lang.org
91-
# after_success: bundle exec s3_website push --headless
92-
9365
before_cache:
9466
# Cleanup the cached directories to avoid unnecessary cache updates
9567
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete

scripts/travis-publish-spec.sh

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/bash
22

3-
if [ "${PRIV_KEY_SECRET}" != "" -a "${TRAVIS_PULL_REQUEST}" = "false" ] ; then
4-
openssl aes-256-cbc -pass "pass:$PRIV_KEY_SECRET" -in spec/id_dsa_travis.enc -out spec/id_dsa_travis -d -a
5-
chmod 600 spec/id_dsa_travis
6-
eval "$(ssh-agent)"
7-
ssh-add -D
8-
ssh-add spec/id_dsa_travis
9-
rsync -e "ssh -o StrictHostKeyChecking=no" -rzv build/spec/ [email protected]:/home/linuxsoft/archives/scala/spec/2.12/
10-
fi
3+
# based on http://www.paperplanes.de/2013/8/13/deploying-your-jekyll-blog-to-s3-with-travis-ci.html
114

5+
set -e
6+
openssl aes-256-cbc -pass "pass:$PRIV_KEY_SECRET" -in spec/id_dsa_travis.enc -out spec/id_dsa_travis -d -a
7+
chmod 600 spec/id_dsa_travis
8+
eval "$(ssh-agent)"
9+
ssh-add -D
10+
ssh-add spec/id_dsa_travis
11+
12+
# the key is restricted using forced commands so that it can only upload to the directory we need here
13+
rsync -e "ssh -o StrictHostKeyChecking=no" -rzv build/spec/ \
14+
[email protected]:/home/linuxsoft/archives/scala/spec/2.12/

0 commit comments

Comments
 (0)