-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
31 lines (28 loc) · 1.14 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
default:
image: 'ruby:2.7'
services:
- postgres:12
# Cache gems in between builds
cache:
paths:
- vendor/ruby
variables:
# Configured in database.yml
POSTGRES_DB: console_test
POSTGRES_USER: hunt-console
POSTGRES_PASSWORD: runner-password
POSTGRES_HOST_AUTH_METHOD: trust # Allows access without password
# This is a basic example for a gem or script which doesn't use
# services such as redis or postgres
before_script:
- ruby -v # Print out ruby version for debugging
# Construct the database url from the setup variables. This SHOULD override settings in config/database.yml.
# See https://edgeguides.rubyonrails.org/configuring.html#connection-preference
- export DATABASE_URL="postgres://$POSTGRES_USER@postgres:5432/$POSTGRES_DB"
# Don't need the Javascript runtime for tests since they only touch the Rails backend.
# - apt-get update -q && apt-get install nodejs -yqq
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
rspec:
script:
- bundle exec rails db:create db:migrate RAILS_ENV=test
- bundle exec rspec