forked from shirasagi/shirasagi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
183 lines (169 loc) · 5.9 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
language: ruby
arch: amd64
os: linux
dist: focal
sudo: false
rvm:
- 2.6.6
cache:
apt: true
bundler: true
directories:
- $HOME/.local
- public/assets
- tmp/cache/assets
services:
- docker
# travis's default mongodb is 3.4 which is too old to use.
#- mongodb
#- elasticsearch
addons:
chrome: stable
apt:
packages:
- imagemagick
- graphicsmagick
- gsfonts
- sox
- libsox-dev
- lame
- libmp3lame-dev
- chromium-chromedriver
# open-jtalk package is blacklisted
# - open-jtalk
# ubuntu 12.04 mecab is too old to work
# - mecab
# - libmecab-dev
# - mecab-ipadic-utf8
bundler_args: "--without development"
env:
global:
- PATH=$PATH:$HOME/.local/bin
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib
- LD_RUN_PATH=$LD_RUN_PATH:$HOME/.local/lib
- TZ=Asia/Tokyo
- CAPYBARA_MAX_WAIT_TIME=45
- CAPYBARA_AJAX_WAIT_TIME=45
- allow_open_jtalk=1
before_install:
- if [ -n "$DOCKER_USERNAME" ]; then echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin; fi
- docker info
- docker pull mongo:4.4
- docker pull osixia/openldap
- docker pull shirasagi/mail
- docker pull shirasagi/michecker
- docker run --name mongo -d -p 27017:27017 mongo:4.4
- docker run --name test_mail -d -p 10143:143 -p 10587:587 shirasagi/mail
- docker ps -a
- fc-list || true
install: # bash .travis.d/install.sh
- bash .travis.d/exec.sh install 20-mecab
- bash .travis.d/exec.sh install 21-mecab-ipadic
- bash .travis.d/exec.sh install 30-hts-engine
- bash .travis.d/exec.sh install 31-open-jtalk
- bash .travis.d/exec.sh install 90-bundle-install
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter --version
- ./cc-test-reporter before-build
before_script: # bash .travis.d/before_script.sh
- bash .travis.d/exec.sh before_script 03-mecab-ruby
- bash .travis.d/exec.sh before_script 05-bin-deploy
- bash .travis.d/exec.sh before_script 10-copy-config
- bash .travis.d/exec.sh before_script 20-fix-mecab-path
- bash .travis.d/exec.sh before_script 30-fix-voice-path
#script: travis_wait 60 bash .travis.d/script.sh
after_script:
- echo $TRAVIS_BUILD_ID
- echo $TRAVIS_BUILD_NUMBER
- echo $TRAVIS_JOB_ID
- echo $TRAVIS_JOB_NUMBER
- echo $TRAVIS_JOB_NAME
jobs:
include:
- stage: compile
script: true
- stage: test
name: "Features #1"
script:
- bundle exec ruby .travis.d/split_specs.rb -p 6 -i 0 spec/features | xargs bundle exec rspec -p 10
- ./cc-test-reporter format-coverage -t simplecov -o codeclimate.2.json coverage/coverage.json
workspaces:
create:
name: codeclimate.2.json
paths: codeclimate.2.json
- name: "Features #2"
script:
- bundle exec ruby .travis.d/split_specs.rb -p 6 -i 1 spec/features | xargs bundle exec rspec -p 10
- ./cc-test-reporter format-coverage -t simplecov -o codeclimate.3.json coverage/coverage.json
workspaces:
create:
name: codeclimate.3.json
paths: codeclimate.3.json
- name: "Features #3"
script:
- bundle exec ruby .travis.d/split_specs.rb -p 6 -i 2 spec/features | xargs bundle exec rspec -p 10
- ./cc-test-reporter format-coverage -t simplecov -o codeclimate.4.json coverage/coverage.json
workspaces:
create:
name: codeclimate.4.json
paths: codeclimate.4.json
- name: "Features #4"
script:
- bundle exec ruby .travis.d/split_specs.rb -p 6 -i 3 spec/features | xargs bundle exec rspec -p 10
- ./cc-test-reporter format-coverage -t simplecov -o codeclimate.5.json coverage/coverage.json
workspaces:
create:
name: codeclimate.5.json
paths: codeclimate.5.json
- name: "Features #5"
script:
- bundle exec ruby .travis.d/split_specs.rb -p 6 -i 4 spec/features | xargs bundle exec rspec -p 10
- ./cc-test-reporter format-coverage -t simplecov -o codeclimate.6.json coverage/coverage.json
workspaces:
create:
name: codeclimate.6.json
paths: codeclimate.6.json
- name: "Features #6"
script:
- bundle exec ruby .travis.d/split_specs.rb -p 6 -i 5 spec/features | xargs bundle exec rspec -p 10
- ./cc-test-reporter format-coverage -t simplecov -o codeclimate.7.json coverage/coverage.json
workspaces:
create:
name: codeclimate.7.json
paths: codeclimate.7.json
- name: Models
script:
- bundle exec rspec -p 10 spec/ --pattern "spec/models/**/*.rb"
- ./cc-test-reporter format-coverage -t simplecov -o codeclimate.8.json coverage/coverage.json
workspaces:
create:
name: codeclimate.8.json
paths: codeclimate.8.json
- name: "Helpers, Jobs, Lib, Mailers, Requests and Validators"
script:
- bundle exec rspec -p 10 spec/{helpers,jobs,lib,mailers,requests,validators}
- ./cc-test-reporter format-coverage -t simplecov -o codeclimate.9.json coverage/coverage.json
workspaces:
create:
name: codeclimate.9.json
paths: codeclimate.9.json
- stage: deploy
name: Code Climate
before_script: skip
script:
- ls -la codeclimate.*
- ./cc-test-reporter sum-coverage codeclimate.*.json -p $(ls -la codeclimate.* | wc -l)
- ./cc-test-reporter upload-coverage -r 8447130d9db9efadd8b86604c1976a4595fd3adc290daf45674490ba949da336
workspaces:
use:
- codeclimate.2.json
- codeclimate.3.json
- codeclimate.4.json
- codeclimate.5.json
- codeclimate.6.json
- codeclimate.7.json
- codeclimate.8.json
- codeclimate.9.json
#notifications:
# webhooks: https://coveralls.io/webhook