forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
81 lines (69 loc) · 2.16 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
sudo: required
language: ruby
rvm:
- 2.7.3
services:
- docker
- redis-server
addons:
mariadb: '10.2'
chrome: stable
cache:
directories:
- $PWD/vendor/.bundle/
- $PWD/public/lib/
git:
depth: false
env:
global:
- CI=true
- GENERATE_REPORT=true
- RAILS_ENV=test
- RAILS_SYSTEM_TESTING_SCREENSHOT=simple
before_install:
- CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
- CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
- sudo wget https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/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 &
- yes | gem update --system --force
- gem install bundler
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
- gem list
- 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
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:
- main
- unstable
- codecov