forked from TEAMMATES/teammates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
114 lines (107 loc) · 4.04 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
language: java
dist: xenial
jdk:
- openjdk8
branches:
only:
- master
- release
notifications:
email: false
before_install:
- |
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md)|(\.txt)|(\.png)|(\.jpg)|(\.gif)|^(LICENSE)|^(docs)'
status_codes=( ${PIPESTATUS[*]} ); git_diff_status=${status_codes[0]}; grep_status=${status_codes[1]}
if [[ $git_diff_status == 0 && $grep_status == 1 && $TRAVIS_PULL_REQUEST != "false" ]]
then
echo "Only doc files or images were updated in PR, not running the CI."
exit
fi
- nvm install 10
install: true
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/executionHistory/
- rm -rf $HOME/.gradle/caches/*/fileContent/
- rm -rf $HOME/.gradle/caches/*/fileHashes/
- rm -rf $HOME/.gradle/caches/*/javaCompile/
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
- rm -rf $HOME/.gradle/caches/*/workerMain/
- rm -rf $HOME/.gradle/caches/*/gc.properties
- rm -rf $HOME/.gradle/caches/journal-1/
- rm -rf node_modules/.cache/uglifyjs-webpack-plugin/
- rm -rf node_modules/.cache/terser-webpack-plugin/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- node_modules
jobs:
include:
- stage: "Prepare Dependencies"
name: "Prepare Dependencies"
script:
- ./gradlew downloadDependencies downloadTestDependencies downloadLinters
- npm install
- npm update
- stage: "Lint/Test"
name: "Lint"
script:
- ./gradlew createConfigs testClasses
- ./gradlew lint --continue
- npm install
- npm run lint
- name: "Component Tests"
script:
- ./gradlew createConfigs componentTests
- ./gradlew jacocoReport
- ./gradlew generateTypes
- npm install
- npm run coverage
after_success:
- bash <(curl -s https://codecov.io/bash)
- name: "E2E Tests - Firefox"
addons:
firefox: "66.0"
services:
- xvfb
before_script:
- export PATH=$HOME/google-cloud-sdk/bin:$PATH
- cd $HOME
- curl -fsS -o google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
- curl -fsSL -o geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
- tar -xzf google-cloud-sdk.tar.gz
- tar -xzf geckodriver.tar.gz
- ./google-cloud-sdk/install.sh --usage-reporting false --path-update false --command-completion false
- cd $TRAVIS_BUILD_DIR
- gcloud -q components install app-engine-java
- mv src/e2e/resources/test.travis.properties src/e2e/resources/test.properties
- ./gradlew createConfigs testClasses generateTypes
- npm install
- npm run build -- --progress=false
- ./gradlew appengineStart
script:
- ./gradlew e2eTests
- name: "E2E Tests - Chrome"
addons:
chrome: stable
services:
- xvfb
before_script:
- export PATH=$HOME/google-cloud-sdk/bin:$PATH
- cd $HOME
- curl -fsS -o google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
- LATEST_CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE"`
- curl -fsSL -o chromedriver.zip "https://chromedriver.storage.googleapis.com/${LATEST_CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
- tar -xzf google-cloud-sdk.tar.gz
- unzip chromedriver.zip
- ./google-cloud-sdk/install.sh --usage-reporting false --path-update false --command-completion false
- cd $TRAVIS_BUILD_DIR
- gcloud -q components install app-engine-java
- mv src/e2e/resources/test.travis-chrome.properties src/e2e/resources/test.properties
- ./gradlew createConfigs testClasses generateTypes
- npm install
- npm run build -- --progress=false
- ./gradlew appengineStart
script:
- ./gradlew e2eTests