.gitlab-ci.yml 2.72 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"

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
11
before_script:
Kamil Trzcinski's avatar
Kamil Trzcinski committed
12
  - source ./scripts/prepare_build.sh
Valery Sizov's avatar
Valery Sizov committed
13
14
  - ruby -v
  - which ruby
15
  - gem install bundler --no-ri --no-rdoc
Valery Sizov's avatar
Valery Sizov committed
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

Douwe Maan's avatar
Douwe Maan committed
37
38
39
40
41
42
43
spec:models:
  script:
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models
  tags:
    - ruby
    - mysql

Douwe Maan's avatar
Douwe Maan committed
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

Douwe Maan's avatar
Douwe Maan committed
73
spinach:project:half:
Valery Sizov's avatar
Valery Sizov committed
74
  script:
Douwe Maan's avatar
Douwe Maan committed
75
76
77
78
79
80
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
  tags:
    - ruby
    - mysql

spinach:project:rest:
Valery Sizov's avatar
Valery Sizov committed
81
  script:
Douwe Maan's avatar
Douwe Maan committed
82
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
Valery Sizov's avatar
Valery Sizov committed
83
84
85
86
  tags:
    - ruby
    - mysql

87
spinach:other:
Valery Sizov's avatar
Valery Sizov committed
88
  script:
89
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other
Valery Sizov's avatar
Valery Sizov committed
90
91
92
93
  tags:
    - ruby
    - mysql

94
teaspoon:
Valery Sizov's avatar
Valery Sizov committed
95
  script:
96
    - RAILS_ENV=test bundle exec teaspoon
Valery Sizov's avatar
Valery Sizov committed
97
98
99
100
  tags:
    - ruby
    - mysql

101
rubocop:
Valery Sizov's avatar
Valery Sizov committed
102
103
104
105
106
107
  script:
    - bundle exec rubocop
  tags:
    - ruby
    - mysql

108
brakeman:
Valery Sizov's avatar
Valery Sizov committed
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
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
128

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
129
bundler:audit:
130
  script:
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
131
132
    - "bundle exec bundle-audit update"
    - "bundle exec bundle-audit check"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
133
134
135
  tags:
    - ruby
    - mysql
136
  allow_failure: true
137
138
139

# Ruby 2.1 jobs

James Lopez's avatar
James Lopez committed
140
spec:ruby21:
141
142
143
  image: ruby:2.1
  script:
    - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
James Lopez's avatar
James Lopez committed
144
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec
145
146
147
148
149
150
  tags:
    - ruby
    - mysql
  only:
  - master

James Lopez's avatar
James Lopez committed
151
spinach:ruby21:
152
153
  image: ruby:2.1
  script:
James Lopez's avatar
James Lopez committed
154
    - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach
155
156
157
158
159
  tags:
    - ruby
    - mysql
  only:
  - master