forked from Coursemology/coursemology2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
70 lines (66 loc) · 2.73 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
dist: trusty
sudo: false
language: ruby
branches:
except:
- /^bundle-update-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}+$/
rvm:
- 2.3.1
addons:
postgresql: "9.4"
hosts:
- coursemology.lvh.me
bundler_args: "--jobs=3 --retry=3 --without development:production --deployment"
cache:
bundler: true
yarn: true
directories:
- travis-phantomjs
- $HOME/.cache/yarn
- $(npm root -g)
- $(npm prefix -g)/bin
env:
global:
- RAILS_ENV=test
matrix:
- GROUP="1,2"
- GROUP="3,4"
- GROUP="5,6"
- GROUP="7,8"
- GROUP="misc"
before_install:
- node --version
- npm list -g yarn --depth=0 || npm install -g yarn
- yarn --version
- gem update bundler
# from https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-177592725
# and also from https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-200965782
- phantomjs --version
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
- phantomjs --version
# Clear cache and download new copy of PhantomJS if the current version doesn't match 2.1.1.
- "if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis-phantomjs; mkdir -p $PWD/travis-phantomjs; fi"
- "if [ $(phantomjs --version) != '2.1.1' ]; then wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs; fi"
- phantomjs --version
- cd client && yarn install --production && cd -
before_script:
- psql -c 'create database coursemology_test;' -U postgres
- psql -c 'create database coursemology_test2;' -U postgres
- cd client && yarn build:production && cd -
- bundle exec rake parallel:setup[2]
script:
- 'if [ "$GROUP" = "misc" ]; then bundle exec consistency_fail; fi'
- 'if [ "$GROUP" = "misc" ]; then bundle exec i18n-tasks health; fi'
- 'if [ "$GROUP" = "misc" ]; then bundle exec rake factory_girl:lint; fi'
- 'if [ "$GROUP" = "misc" ]; then bundle exec rake assets:precompile; fi'
- 'if [ "$GROUP" = "misc" ]; then cd client && yarn; fi'
- 'if [ "$GROUP" = "misc" ]; then yarn lint --prefix; fi'
- 'if [ "$GROUP" = "misc" ]; then yarn test; fi'
- 'if [ "$GROUP" = "misc" ]; then cd ..; fi'
- 'if [ "$GROUP" != "misc" ]; then export CODECOV_FLAG=backend; fi'
- 'if [ "$GROUP" != "misc" ]; then bundle exec parallel_rspec spec -n 8 --only-group $GROUP --runtime-log spec/fixtures/parallel_runtime_rspec.log; fi'
after_script:
- 'if [ "$GROUP" = "misc" ]; then bash <(curl -s https://codecov.io/bash) -F frontend -s client/coverage; fi'
notifications:
slack: coursemology:kdSjdF4xtXGOBIvMsbIF4gQ6