-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
52 lines (41 loc) · 966 Bytes
/
.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
image: ruby:2.7.8
services:
- postgres:latest
variables:
POSTGRES_DB: wulin_app_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
cache:
key:
files:
- Gemfile.lock
paths:
- vendor/bundle
stages:
- test
before_script:
- apt-get update -qy
- apt-get install -qy nodejs
- apt-get install -qy libfontconfig1
# gems
- gem install bundler -v 2.4.22
- cp spec/wulin_app/config/database.ci.yml spec/wulin_app/config/database.yml
# cache dir
- mkdir -p vendor/bundle
- bundle config set path vendor/bundle
# install gems
- bundle check || bundle install --jobs 8
assets_precompile:
stage: test
script:
- RAILS_ENV=development bundle exec rake assets:precompile
rspec:
stage: test
script:
- RAILS_ENV=test bundle exec rake db:drop db:create db:migrate
- RAILS_ENV=test bundle exec rspec spec
ruby_lint:
stage: test
script:
- bundle exec rake standard