forked from sncf-connect-tech/zucchini-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
62 lines (51 loc) · 1.67 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
language: java
sudo: required
services:
- docker
addons:
apt:
packages:
# Cypress integration with Travis : https://docs.cypress.io/guides/guides/continuous-integration.html#Travis
# Ubuntu 16+ does not install this dependency by default, so we need to install it ourselves
- libgconf-2-4
jdk:
- oraclejdk8
- openjdk11
- openjdk12
before_install:
# Install a recent node version
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
- nvm install 10 && nvm use 10
# Install Yarn
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
install:
# Install UI dependencies
- ./gradlew yarnInstall
# Assemble project
- ./gradlew assemble
script:
- ./gradlew check
- ./gradlew runCucumber dryRunCucumber
- ./gradlew dockerBuild
- ./gradlew dockerComposeUp
- "(cd zucchini-ui-e2e-tests && env CYPRESS_VIDEO=false CYPRESS_DEFAULT_COMMAND_TIMEOUT=15000 yarn test)"
after_success:
# Build, then push image to Docker
- >-
if [[ "$DOCKER_USERNAME" != "" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_JDK_VERSION" == "openjdk11" ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
./gradlew dockerPush
fi
# Cache section
# Gradle: https://docs.travis-ci.com/user/languages/java/#Projects-Using-Gradle
# YARN: https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#Caching-with-yarn
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
yarn: true
directories:
- ~/.gradle/caches/
- ~/.gradle/wrapper/
- ~/.cache