-
Notifications
You must be signed in to change notification settings - Fork 82
/
.travis.yml
175 lines (154 loc) · 6.34 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: ~> 1.0
language: scala
addons:
apt:
packages:
- conntrack
# Only build non-pushes (so PRs, API requests & cron jobs) OR forks OR main branch builds
# https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
if: type != push OR repo != lagom/lagom-samples OR branch IN (1.5.x, 1.6.x)
env:
global:
- TRAVIS_JDK=11
- JABBA_HOME=$HOME/.jabba
- RUN_DROP_TRAVIS_CACHES_STAGE=true
before_install:
# 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://raw.githubusercontent.com/shyiko/jabba/0.11.2/install.sh && bash jabba-install.sh; fi
- . ~/.jabba/jabba.sh
install:
# Using ~ makes jabba installs the latest version for that major JDK release
- jabba install $(jabba ls-remote "adopt@~1.$TRAVIS_JDK.0-0" --latest=patch)
- unset _JAVA_OPTIONS
# Using ~ with ls works in a similar way to jabba install described above
- export JAVA_HOME="$JABBA_HOME/jdk/$(jabba ls "adopt@~1.${TRAVIS_JDK}.0-0" | head -1)" && export PATH="$JAVA_HOME/bin:$PATH" && java -Xmx32m -version
cache:
directories:
- "$HOME/.cache/coursier"
- "$HOME/.ivy2/cache"
- "$HOME/.m2/repository"
- "$HOME/.jabba/jdk"
- "$HOME/.sbt"
before_cache:
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
- find $HOME/.sbt -name "*.lock" -delete
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/repository
name: "drop-travis-caches"
# Mixed Persistence Samples
- stage: test-java-11
name: "Run tests Mixed Persistence (java)"
script: "cd mixed-persistence/mixed-persistence-java-sbt && sbt test stage"
- name: "Run tests Mixed Persistence (scala)"
script: "cd mixed-persistence/mixed-persistence-scala-sbt && sbt test stage"
# gRPC Samples
- name: "Run tests gRPC example (java/sbt)"
script: "cd grpc-example/grpc-example-java && sbt test stage"
- name: "Run tests gRPC example (java/Maven)"
script: "cd grpc-example/grpc-example-java && mvn test"
- name: "Run tests gRPC example (scala)"
script: "cd grpc-example/grpc-example-scala && sbt test stage"
- name: "Run integration tests gRPC example (scala)"
script: "cd grpc-example/grpc-example-scala && ./scripts/setup-minikube-for-linux.sh && ./scripts/test.sh "
# Shopping-Cart Samples
- name: "Run tests Shopping Cart example (java/sbt)"
script:
- docker-compose -f shopping-cart/shopping-cart-java/docker-compose.yml up -d
- sleep 30s
- cd shopping-cart/shopping-cart-java && sbt test
- name: "Run tests Shopping Cart example (java/mvn)"
script:
- docker-compose -f shopping-cart/shopping-cart-java/docker-compose.yml up -d
- sleep 30s
- cd shopping-cart/shopping-cart-java && mvn test
- name: "Run tests Shopping Cart example (scala/sbt)"
script:
- docker-compose -f shopping-cart/shopping-cart-scala/docker-compose.yml up -d
- sleep 30s
- cd shopping-cart/shopping-cart-scala && sbt test
# Couchbase Persistence Samples
- name: "Run tests Couchbase Persistence (java)"
script:
- docker-compose -f couchbase-persistence/docker/docker-compose.yml up -d couchbase
- sleep 30s
- cd couchbase-persistence/couchbase-persistence-java-mvn && mvn test
- name: "Run tests Couchbase Persistence (scala)"
script:
- docker-compose -f couchbase-persistence/docker/docker-compose.yml up -d couchbase
- sleep 30s
- "cd couchbase-persistence/couchbase-persistence-scala-sbt && sbt test stage"
#
# Java 8 Jobs
#
# Mixed Persistence Samples
- stage: test-java-8
name: "Run tests Mixed Persistence (java)"
env: TRAVIS_JDK=8
script: "cd mixed-persistence/mixed-persistence-java-sbt && sbt test stage"
- name: "Run tests Mixed Persistence (scala)"
env: TRAVIS_JDK=8
script: "cd mixed-persistence/mixed-persistence-scala-sbt && sbt test stage"
# gRPC Samples
- name: "Run tests gRPC example (java)"
env: TRAVIS_JDK=8
script: "cd grpc-example/grpc-example-java && sbt test stage"
- name: "Run tests gRPC example (scala)"
env: TRAVIS_JDK=8
script: "cd grpc-example/grpc-example-scala && sbt test stage"
# Shopping-Cart Samples
- name: "Run tests Shopping Cart example (java/sbt)"
env: TRAVIS_JDK=8
script:
- docker-compose -f shopping-cart/shopping-cart-java/docker-compose.yml up -d
- sleep 30s
- cd shopping-cart/shopping-cart-java && sbt test
- name: "Run tests Shopping Cart example (java/mvn)"
env: TRAVIS_JDK=8
script:
- docker-compose -f shopping-cart/shopping-cart-java/docker-compose.yml up -d
- sleep 30s
- cd shopping-cart/shopping-cart-java && mvn test
- name: "Run tests Shopping Cart example (scala/sbt)"
env: TRAVIS_JDK=8
script:
- docker-compose -f shopping-cart/shopping-cart-scala/docker-compose.yml up -d
- sleep 30s
- cd shopping-cart/shopping-cart-scala && sbt test
# Couchbase Persistence Samples
- name: "Run tests Couchbase Persistence (java)"
env: TRAVIS_JDK=8
script:
- docker-compose -f couchbase-persistence/docker/docker-compose.yml up -d couchbase
- sleep 30s
- cd couchbase-persistence/couchbase-persistence-java-mvn && mvn test
- name: "Run tests Couchbase Persistence (scala)"
env: TRAVIS_JDK=8
script:
- docker-compose -f couchbase-persistence/docker/docker-compose.yml up -d couchbase
- sleep 30s
- "cd couchbase-persistence/couchbase-persistence-scala-sbt && sbt test stage"
stages:
- name: drop-travis-caches
# to drop caches trigger a custom build with
# env:
# global:
# - RUN_DROP_TRAVIS_CACHES_STAGE=true
if: env(RUN_DROP_TRAVIS_CACHES_STAGE) = true
- name: test-java-11
- name: test-java-8
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/2aa0aeda88d31fe293d4
on_success: change
on_failure: always
on_start: never