-
Notifications
You must be signed in to change notification settings - Fork 158
/
.travis.yml
70 lines (61 loc) · 1.6 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
language: ruby
dist: trusty
rvm:
- 2.6.5
node_js:
- 13
env:
global:
- RAILS_ENV=test
- DB_HOST='127.0.0.1'
- DB_USER='swbench'
- DB_PASS='swbench'
- DB_NAME='swbench'
cache:
directories:
- $PWD/vendor/.bundle/
- $PWD/public/lib/
services:
- docker
- mysql
before_install:
- ./script/dependencies.sh > /dev/null 2>&1
- cp config/database.yml.example config/database.yml
- cp config/config.yml.example config/config.yml
- cp db/schema.rb.example db/schema.rb
- bundle config set path 'vendor/.bundle/'
install:
- bundle install
- if [ $RAILS_ENV == 'production' ]; then
mysql -e "CREATE DATABASE swbench;";
mysql -e "CREATE USER 'swbench'@'%' IDENTIFIED BY 'swbench';";
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'swbench'@'%';";
bundle exec rake db:schema:load;
bundle exec rake db:migrate;
else
yarn check || yarn install;
bundle exec rake db:create;
bundle exec rake db:schema:load;
bundle exec rake db:migrate;
fi
jobs:
include:
- name: "Models Tests"
script: rails test:models
- name: "Helpers Tests"
script: ruby -I test test/models/helpers/*.rb
- name: "Controllers Tests"
script: rails test:controllers
- name: "Integration Tests"
script: rails test:integration
- name: "Rubocop Lint"
script: rubocop
- name: "System Tests"
script: rails test:system
- name: "Docker Builds"
script: docker build -t swbench .
- name: "Asset Precompilation"
env:
- RAILS_ENV=production
script:
- bundle exec rake assets:precompile