forked from TEAMMATES/teammates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
109 lines (102 loc) · 3.93 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
language: java
jdk:
- oraclejdk8
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)|^(\.templates)'
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 IDE configurations 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/*/fileHashes/
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
- rm -rf $HOME/.gradle/caches/*/workerMain/
- 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 run lint
- name: "Component Tests"
script:
- ./gradlew createConfigs componentTests
- ./gradlew jacocoReport
- ./gradlew generateTypes
- npm run coverage
after_success:
- bash <(curl -s https://codecov.io/bash)
- name: "E2E Tests - Firefox"
addons:
firefox: "63.0"
before_script:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid \
--make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1440x900x16"
- export DISPLAY=:99.0
- 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.23.0/geckodriver-v0.23.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 run build -- --progress=false
- ./gradlew appengineStart
script:
- ./gradlew e2eTests
- name: "E2E Tests - Chrome"
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
- 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 chromedriver.zip https://chromedriver.storage.googleapis.com/2.44/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 run build -- --progress=false
- ./gradlew appengineStart
script:
- ./gradlew e2eTests