forked from lagom/lagom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
110 lines (97 loc) · 3.86 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
version: ~> 1.0
language: scala
# Only build non-pushes (so PRs, API requests & cron jobs) OR tags OR forks OR main branch builds
# https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
if: type != push OR tag IS present OR repo != lagom/lagom OR branch IN (master, 1.6.x, 1.5.x, 1.4.x)
addons:
apt:
packages:
# Needed for `xmllint` which is used to validate pom files
- libxml2-utils
- xmlstarlet
# Used to download maven xsd file
- wget
env:
matrix:
- TRAVIS_JDK=11
before_install:
- |
curl -Ls https://git.io/sbt -o sbt || travis_terminate 1
chmod 0755 sbt || travis_terminate 1
sudo mv sbt /usr/local/bin/sbt || travis_terminate 1
# See https://github.com/travis-ci/travis-ci/issues/4629#issuecomment-239493916
- rm ~/.m2/settings.xml
- if [ ! -f ~/.jabba/jabba.sh ]; then curl -L -v --retry 5 -o jabba-install.sh https://git.io/jabba && bash jabba-install.sh; fi
- . ~/.jabba/jabba.sh
install: jabba install $(jabba ls-remote "adopt@~1.$TRAVIS_JDK.0-0" --latest=patch) && jabba use "$_" && java -Xmx32m -version
git:
depth: false # Avoid sbt-dynver not seeing the tag
stages:
- name: drop-travis-caches
- name: validations-and-test
- name: test-build-tools
jobs:
include:
- stage: drop-travis-caches
# Introduced 2020-10-19 as we noticed serious problems with Travis' caching
script:
- rm -rf $HOME/.cache/coursier
- rm -rf $HOME/.ivy2/cache
#- rm -rf $HOME/.jabba
- rm -rf $HOME/.sbt
- rm -rf $HOME/.m2/repositories
- sbt +Test/update
name: "drop-and-rehydrate-travis-caches"
- stage: validations-and-test
script: bin/test-code-style
name: "Code validations (format, binary compatibilty, etc.)"
- script: SCALA_VERSION=2.12.13 bin/test-2.1x
name: "Run tests for Scala 2.12"
- script: SCALA_VERSION=2.12.13 bin/test-2.1x
env: TRAVIS_JDK=8
name: "Run tests for Scala 2.12 and Java 8"
- script: SCALA_VERSION=2.13.5 bin/test-2.1x
name: "Run tests for Scala 2.13"
- script: SCALA_VERSION=2.12.13 bin/test-multi-jvm-2.1x
name: "Run multi-jvm tests for Scala 2.12"
- script: SCALA_VERSION=2.12.13 bin/test-multi-jvm-2.1x
env: TRAVIS_JDK=8
name: "Run multi-jvm tests for Scala 2.12 and Java 8"
- script: SCALA_VERSION=2.13.5 bin/test-multi-jvm-2.1x
name: "Run multi-jvm tests for Scala 2.13"
## "Documentation validations and tests" runs on JDK11 which fails `sbt unidoc` as
## soon as we bump sbt beyond 1.4.0. See https://github.com/lagom/lagom/issues/3240
##- script: bin/test-documentation
## name: "Documentation validations and tests"
## Until the release is run in JDK11 we must have 100% support for docs
## generation in JDK8 (this means `unidoc` must be run in every PR)
- script: bin/test-documentation
#- script: bin/test-docs-code-only
env: TRAVIS_JDK=8
name: "Documentation tests (Java 8)"
- stage: test-build-tools
script: SCALA_VERSION=2.12.13 bin/test-sbt
name: "Scripted tests for sbt 1"
- script: SCALA_VERSION=2.12.13 bin/test-sbt
env: TRAVIS_JDK=8
name: "Scripted tests for sbt 1 and Java 8"
- script: bin/test-maven
name: "PublishM2 and test Maven"
- script: bin/test-maven
name: "PublishM2 and test Maven using Java 8"
env: TRAVIS_JDK=8
cache:
directories:
- $HOME/.cache/coursier
- $HOME/.ivy2/cache
- $HOME/.jabba
- $HOME/.sbt
- $HOME/.m2/repository
before_cache:
# Ensure changes to the cache aren't persisted
- rm -rf $HOME/.ivy2/cache/com.lightbend.lagom/*
- rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.lightbend.lagom/*
- rm -r $HOME/.m2/repository/com/lightbend/lagom/*
# Delete all ivydata files since ivy touches them on each build
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
- find $HOME/.sbt -name "*.lock" -delete