forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
113 lines (97 loc) · 5.77 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
sudo: required # GCE VMs have better performance (will be upgrading to premium VMs soon)
language: scala
jdk: openjdk8
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt
- build/
before_script:
- (cd admin && ./init.sh)
stages:
- name: build # also builds the spec using jekyll
# tests are running into time limits (will re-enable once Jason's partest speedups are in)
- name: test
if: env(bla) = thisVarIsNotSet AND type != pull_request # just disabling tests for now, but commenting the stage here doesn't do the trick
- name: publish
if: type != pull_request
# see comment in `bootstrap_fun` for details on the procedure
# env available in each stage
# - by travis config (see below): secret env vars
# - by `common` script: WORKSPACE, IVY2_DIR, SBT_CMD, integrationRepoUrl
# - by `bootstrap_fun`: publishPrivateTask, ...
# env computed in first stage, passed on to later stages with the `build/env` file
# - by `determineScalaVersion`: SCALA_VER, publishToSonatype
# - by `buildModules` / `constructUpdatedModuleVersions`: updatedModuleVersions
jobs:
include:
- stage: build
# currently, not touching PR validation
# (also, we couldn't even, because the password to publish to artifactory is not there :-/)
if: type != pull_request
script:
- source scripts/common
- source scripts/bootstrap_fun
- determineScalaVersion
- deriveModuleVersions
- removeExistingBuilds $integrationRepoUrl
- clearIvyCache
- if [ ! -z "$STARR_REF" ]; then buildStarr; fi
- buildLocker
- rm -rf build/ # ensure we resolve from artifactory
- buildModules
- buildQuick clean publish
- set | grep -E '^SCALA_VER=|^SCALA_BINARY_VER=|^scalaVersionTasks=|^XML_VER=|^PARTEST_VER=|^SCALACHECK_VER=|^XML_BUILT=|^PARTEST_BUILT=|^SCALACHECK_REF=|^updatedModuleVersions=|^publishToSonatype=' > build/env
- cat build/env
# this builds the spec using jekyll
# based on http://www.paperplanes.de/2013/8/13/deploying-your-jekyll-blog-to-s3-with-travis-ci.html
- stage: build
script: bundle exec jekyll build -s spec/ -d build/spec
rvm: 2.2
install: bundle install
# the key is restricted using forced commands so that it can only upload to the directory we need here
after_success: ./scripts/travis-publish-spec.sh
# be careful to not set any env vars, as this will result in a cache miss
- &test
stage: test
before_script:
- source build/env
- if [ -z "$SCALA_VER" ]; then echo "Environment not propagated. Caching issue?"; cat build/env ; exit 1; fi
- source scripts/common
- source scripts/bootstrap_fun
# - find build -type f -exec touch {} + # "set antStyle := true" seems to cause really long compiles for the test suite??
script: buildQuick testRest # shouldn't rebuild, since build/ is cached
- <<: *test
script: buildQuick testPosPres
- <<: *test
script: buildQuick testRun
- script: testStability
- stage: publish # note that it's important that this runs on a fresh VM, so we're sure to resolve scala from artifactory, and not out of local cache (which was overwritten during bootstrap, somewhat unorthodoxly)
script:
- source build/env
- if [ -z "$SCALA_VER" ]; then echo "Environment not propagated. Caching issue?"; cat build/env ; exit 1; fi
- source scripts/common
- source scripts/bootstrap_fun
- if [ "$publishToSonatype" = "yes" ]; then publishSonatype; fi
- triggerScalaDist
# using bash conditional, because a travis condition on the stage won't work:
# the `env` function only picks stuff up from yaml, not variables set in bash,
# and we can't supply more env vars using a custom build from the web
# It would work using the API according to https://github.com/travis-ci/docs-travis-ci-com/issues/1485#issuecomment-351726416,
# but that's too much right now.
env:
global:
- secure: "P8EqpZoin/YTnwel9TTxSSAHtXfZ4M262BKXlYUZmjoQsjyvXDAeZ7yAqgAvX5BeRFrGkBToPiE+V60stdWkPKs3+9COw2BDUB1CULBHhRY9Lxordmz0xVhgEfsoH4f6r6wOlIQ9kuaWhmP+JdB/mzOHZhLch9ziPi8O46Z8t4k=" # PRIV_KEY_SECRET, for scripts/travis-publish-spec.sh
- secure: "T1fxtvLTxioyXJYiC/zVYdNYsBOt+0Piw+xE04rB1pzeKahm9+G2mISdcAyqv6/vze9eIJt6jNHHpKX32/Z3Cs1/Ruha4m3k+jblj3S0SbxV6ht2ieJXLT5WoUPFRrU68KXI8wqUadXpjxeJJV53qF2FC4lhfMUsw1IwwMhdaE8=" # PRIVATE_REPO_PASS
- secure: "feE5A8mYNpkNQKVwCj3aXrwjVrJWh/4ENpRfFlr2HOD9ORk1GORD5Yq907WZd+dTkYK54Lh1gA+qHOCIDgJHbi9ZLU+kjzEjtYKF6lQy6Wb0LI8smTOnAA6IWVVYifiXw8d66MI2MKZb2jjGeIzy8Q00SZjLhEGjLyTeCIB88Ws=" # SONA_USER
- secure: "ek3As5q2tL8UBXcxSBbv4v5YgsoPD41SCzPOSu72kzfbngyxgQxrcziU5pIM+Lib9KaWex7hVVWNL38tMyDbu+0OpDv8bPjMujzlDx5I2pJUfuOJo7QRYsJE1nsXcY4cA72cCLfbRcLEkvtDAhcdLSaUOqlyQe5BY4X4fY5eoPA=" # SONA_PASS
- secure: "dbAvl6KEuLwZ0MVQPZihFsPzCdiLbX0EFk3so+hcfEbksrmLQ1tn4X5ZM7Wy1UDR8uN9lxngEwHch7a7lKqpugzmXMew9Wnikr9WBWbJT77Z+XJ/jHI6YuiCRpRo+nvxXGp9Ry80tSIgx5eju0J83IaJL41BWlBkvyAd7YAHORI=" # GPG_SUBKEY_SECRET
- secure: "ee0z/1jehBjFa2M2JlBHRjeo6OEn/zmVl72ukBP1ISeKqz18Cswc4gDI5tV9RW9SlYFLkIlGsR2qnRCyJ/pqgQLcNdrpsCRFFc79oyLhfEtmPdAHlWfj4RSP68zINRtDdFuJ8iSy8XYP0NaqpVIYpkNdv9I6q7N85ljmMQpHO+U=" # TRAVIS_TOKEN (login with GitHub as lrytz)
# using S3 would be simpler, but we want to upload to scala-lang.org
# after_success: bundle exec s3_website push --headless
before_cache:
# Cleanup the cached directories to avoid unnecessary cache updates
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
- find $HOME/.sbt -name "*.lock" -print -delete
notifications:
webhooks: https://scala-ci.typesafe.com/benchq/webhooks/travis