forked from loomio/loomio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
74 lines (65 loc) · 2.63 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
language: ruby
rvm:
- 2.6.5
dist: trusty
sudo: required
group: edge
cache:
bundler: true
directories:
- vendor/bundle
- client/node_modules
- vue/node_modules
addons:
firefox: latest
postgresql: "9.6"
chrome: stable
artifacts:
paths:
- vue/tests/reports/
- client/angular/test/
target_paths:
- ${SCREENSHOTS_PATH}
env:
global:
- DB=postgresql
- DISPLAY=:99.0
- PATH=$PATH:$TRAVIS_BUILD_DIR/bin
- RAILS_ENV=test
- PUMA_WORKERS=2
- MIN_THREADS=3
- MAX_THREADS=3
- SCREENSHOTS_PATH=/`date "+%Y-%m-%d_%H-%M"`/${TRAVIS_REPO_SLUG}/
matrix:
# - TASK=e2e
- TASK=rspec
- TASK=plugins
- TASK=vue
before_install:
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
- gem install bundler
- if [ "$TASK" = "e2e" ]; then nvm install 11 && nvm use 11 && npm install -g gulp; fi
- if [ "$TASK" = "vue" ]; then nvm install 12 && nvm use 12; fi
install:
- bundle install --without development --deployment --jobs=3 --retry=3
- if [ "$TASK" = "e2e" ]; then cd client; npm rebuild node-sass; npm install; cd ..; fi
- if [ "$TASK" = "vue" ]; then cd vue; npm install; cd ..; fi
before_script:
- cp config/database.yml.$DB config/database.yml
- createdb loomio_test
- bundle exec rake db:setup
- if [ "$TASK" = "vue" ]; then export USE_VUE=1; fi
- if [ "$TASK" = "plugins" ]; then bundle exec rake plugins:fetch plugins:install; fi
- if [ "$TASK" = "vue" ] || [ "$TASK" = "e2e" ]; then bundle exec rails server -b 0.0.0.0 > /dev/null & fi
# - if [ "$TASK" = "vue" ] || [ "$TASK" = "e2e" ]; then bundle exec sidekiq > /dev/null & fi
- if [ "$TASK" = "e2e" ]; then bundle exec rake client:build; fi
- if [ "$TASK" = "vue" ]; then cd vue && npm run build && cd ..; fi
- if [ "$TASK" = "vue" ] || [ "$TASK" = "e2e" ]; then wget http://localhost:3000/; fi
script:
- if [ "$TASK" = "rspec" ]; then bundle exec rspec; fi
- if [ "$TASK" = "e2e" ]; then cd client && gulp nightwatch:core --retries 2 && cd .. ; fi
- if [ "$TASK" = "plugins" ]; then bundle exec rspec plugins; fi
- if [ "$TASK" = "vue" ]; then cd vue && npm run test:e2e:standalone && cd .. ; fi
after_script:
- if [ "$TASK" = "vue" ]; then cd ${TRAVIS_BUILD_DIR}/vue/tests/reports && bundle exec ruby rename_screenshots.rb && bundle exec ruby generate_screenshots_index.rb && cd.. ; fi
- if [ "$TASK" = "e2e" ]; then cd ${TRAVIS_BUILD_DIR}/client/angular/test && bundle exec ruby rename_screenshots.rb && bundle exec ruby generate_screenshots_index.rb && cd.. ; fi