-
Notifications
You must be signed in to change notification settings - Fork 26
/
.gitlab-ci.yml
44 lines (39 loc) · 1.17 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
---
image: circleci/ruby:3.0.3-node-browsers
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
services:
- postgres:12.9
variables:
POSTGRES_HOST: postgres
POSTGRES_DB: thape_web_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "postgres"
CACHE_FALLBACK_KEY: $CI_COMMIT_REF_SLUG
# Cache gems in between builds
cache:
- key:
files:
- Gemfile.lock
paths:
- vendor/ruby
- key:
files:
- yarn.lock
paths:
- .yarn-cache/
before_script:
- bundle config mirror.https://rubygems.org https://gems.ruby-china.com
- bundle config set path 'vendor' # Install dependencies into ./vendor/ruby
- bundle install -j $(nproc)
- yarn install --cache-folder .yarn-cache
test:
script: |
cp config/database.yml.example config/database.yml
cp config/mailer.yml.example config/mailer.yml
cp config/credentials.yml.example config/credentials.yml
bin/rails credentials:encrypt
bin/rails db:drop RAILS_ENV=test
bin/rails db:setup RAILS_ENV=test
bin/rails test