/
.gitlab-ci.yml
74 lines (65 loc) · 1.08 KB
/
.gitlab-ci.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
image: "ruby:2.6.3"
stages:
- prepare
- testing
- deploy
variables:
BUNDLE_PATH: "cache/bundler"
RAILS_ENV: "test"
MONGOID_SIGMA_HOST: "database-1:27017"
REDIS_URL: "redis://redis-1:6379/0"
SIDEKIQ_REDIS_URL: "redis://redis-1:6379/1"
.cache: &cache
key: "$CI_COMMIT_REF_NAME"
paths:
- cache/
.test-job:
cache:
<<: *cache
policy: pull
stage: testing
# [ Jobs ]
prepare:
cache:
<<: *cache
stage: prepare
script:
- bundle --version
- bundle install
tags:
- ruby
rubocop:
extends: .test-job
script:
- bundle exec rubocop
allow_failure: true
tags:
- ruby
rspec:
extends: .test-job
services:
- name: mongo:3
alias: database-1
- name: redis:4.0-alpine
alias: redis-1
script:
- bundle exec rake db:setup
- bundle exec rspec
artifacts:
paths:
- coverage/
tags:
- ruby
# Coverage report
pages:
stage: deploy
dependencies:
- rspec
script:
- mv coverage/ public/
artifacts:
paths:
- public
expire_in: 30 days
only:
- master@lu-ci/lucia/lucia-core