forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (62 loc) · 1.83 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
sudo: required
language: ruby
rvm:
- 2.4.4
services:
- docker
- redis-server
addons:
mariadb: '10.2'
cache:
directories:
- $PWD/vendor/.bundle/
- $PWD/public/lib/
git:
depth: false
env:
global:
- CI=true
- GENERATE_REPORT=true
- RAILS_ENV=test
before_install:
- sudo wget https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip
- sudo unzip chromedriver_linux64.zip -d /usr/local/bin/
- sudo chmod +x /usr/local/bin/chromedriver
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
install:
- rm -rf test/reports
- cp config/database.yml.example config/database.yml
- cp db/schema.rb.example db/schema.rb
- bundle config set path 'vendor/.bundle/'
- bundle install
- if [ $RAILS_ENV != 'production' ]; then
yarn check || yarn install;
fi
- mysql -e "CREATE DATABASE plots;";
- bundle exec rake db:schema:load
- bundle exec rake db:migrate
- if [ "$TRAVIS_PULL_REQUEST" == "true" ]; then
gem install danger danger-junit google-cloud-storage;
fi
- echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > /tmp/credentials.json # needs to be a path to a json file, so we shuffle...
jobs:
include:
- name: "Unit Tests"
script: bundle exec rails test test/unit
- name: "Functional Tests"
script: bundle exec rails test test/functional
- name: "Integration Tests"
script: bundle exec rails test test/integration
- name: "System Tests"
script: bundle exec rails test:system > /dev/null
after_script:
- echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml;
- tail -n +2 -q ./test/reports/TEST*.xml >> output.xml
- if [ $TRAVIS_PULL_REQUEST == "true" ]; then
bundle exec danger --verbose;
fi
branches:
only:
- master
- unstable
- codecov