.gitlab-ci.yml 4.1 KB
Newer Older
1
image: "ruby:2.2"
2 3 4 5 6 7 8 9 10

services:
  - mysql:latest
  - postgres:latest
  - redis:latest

variables:
  MYSQL_ALLOW_EMPTY_PASSWORD: "1"

D
Dmitriy Zaporozhets 已提交
11
before_script:
K
Kamil Trzcinski 已提交
12
  - source ./scripts/prepare_build.sh
V
Valery Sizov 已提交
13 14
  - ruby -v
  - which ruby
15
  - gem install bundler --no-ri --no-rdoc
V
Valery Sizov 已提交
16 17 18
  - cp config/gitlab.yml.example config/gitlab.yml
  - touch log/application.log
  - touch log/test.log
19
  - bundle install --without postgres production --jobs $(nproc)  "${FLAGS[@]}"
20
  - RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate
21 22 23

spec:feature:
  script:
24
    - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
25 26 27 28 29 30 31 32 33 34 35 36
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature
  tags:
    - ruby
    - mysql

spec:api:
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api
  tags:
    - ruby
    - mysql

D
Douwe Maan 已提交
37 38 39 40 41 42 43
spec:models:
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models
  tags:
    - ruby
    - mysql

D
Douwe Maan 已提交
44 45 46 47 48 49 50 51 52 53 54 55 56 57
spec:lib:
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib
  tags:
    - ruby
    - mysql

spec:services:
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services
  tags:
    - ruby
    - mysql

58 59 60 61 62 63
spec:benchmark:
  script:
    - RAILS_ENV=test bundle exec rake spec:benchmark
  tags:
    - ruby
    - mysql
64
  allow_failure: true
65

66 67 68 69 70 71 72
spec:other:
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other
  tags:
    - ruby
    - mysql

D
Douwe Maan 已提交
73
spinach:project:half:
V
Valery Sizov 已提交
74
  script:
D
Douwe Maan 已提交
75 76 77 78 79 80
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
  tags:
    - ruby
    - mysql

spinach:project:rest:
V
Valery Sizov 已提交
81
  script:
D
Douwe Maan 已提交
82
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
V
Valery Sizov 已提交
83 84 85 86
  tags:
    - ruby
    - mysql

87
spinach:other:
V
Valery Sizov 已提交
88
  script:
89
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other
V
Valery Sizov 已提交
90 91 92 93
  tags:
    - ruby
    - mysql

94
teaspoon:
V
Valery Sizov 已提交
95
  script:
96
    - RAILS_ENV=test bundle exec teaspoon
V
Valery Sizov 已提交
97 98 99 100
  tags:
    - ruby
    - mysql

101
rubocop:
V
Valery Sizov 已提交
102 103 104 105 106 107
  script:
    - bundle exec rubocop
  tags:
    - ruby
    - mysql

108
brakeman:
V
Valery Sizov 已提交
109 110 111 112
  script:
    - bundle exec rake brakeman
  tags:
    - ruby
113
    - mysql
114 115 116 117 118 119 120

flog:
  script:
    - bundle exec rake flog
  tags:
    - ruby
    - mysql
121 122 123 124 125 126 127

flay:
  script:
    - bundle exec rake flay
  tags:
    - ruby
    - mysql
D
Dmitriy Zaporozhets 已提交
128

D
Dmitriy Zaporozhets 已提交
129
bundler:audit:
130
  script:
D
Dmitriy Zaporozhets 已提交
131 132
    - "bundle exec bundle-audit update"
    - "bundle exec bundle-audit check"
D
Dmitriy Zaporozhets 已提交
133 134 135
  tags:
    - ruby
    - mysql
136
  allow_failure: true
137 138 139

# Ruby 2.1 jobs

140
spec:feature:ruby21:
141
  image: ruby:2.1
142 143
  only:
  - master
144 145
  script:
    - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature
  tags:
    - ruby
    - mysql

spec:api:ruby21:
  image: ruby:2.1
  only:
  - master
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api
  tags:
    - ruby
    - mysql

spec:models:ruby21:
  image: ruby:2.1
  only:
  - master
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models
167 168 169
  tags:
    - ruby
    - mysql
170 171 172

spec:lib:ruby21:
  image: ruby:2.1
173 174
  only:
  - master
175 176 177 178 179
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib
  tags:
    - ruby
    - mysql
180

181
spec:services:ruby21:
182
  image: ruby:2.1
183 184
  only:
  - master
185
  script:
186
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services
187 188 189
  tags:
    - ruby
    - mysql
190 191 192

spec:benchmark:ruby21:
  image: ruby:2.1
193 194
  only:
  - master
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
  script:
    - RAILS_ENV=test bundle exec rake spec:benchmark
  tags:
    - ruby
    - mysql
  allow_failure: true

spec:other:ruby21:
  image: ruby:2.1
  only:
  - master
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other
  tags:
    - ruby
    - mysql

spinach:project:half:ruby21:
  image: ruby:2.1
  only:
  - master
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
  tags:
    - ruby
    - mysql

spinach:project:rest:ruby21:
  image: ruby:2.1
  only:
  - master
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
  tags:
    - ruby
    - mysql

spinach:other:ruby21:
  image: ruby:2.1
  only:
  - master
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other
  tags:
    - ruby
    - mysql