-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ef55b0
commit 87a2499
Showing
2 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,42 @@ | ||
workspace: true | ||
|
||
stages: | ||
- rubocop | ||
- build | ||
- test | ||
|
||
jobs: | ||
- name: build:prepare | ||
stage: build | ||
image: cimg/ruby:3.2.0 | ||
script: | ||
- sudo cp database-ci.yml config/database.yml | ||
- bundle config set path 'vendor/bundle' | ||
- sudo gem update --system | ||
- sudo bundle install | ||
cache: | ||
- key: vendor_$CI_BRANCH | ||
paths: | ||
- vendor/bundle | ||
- name: test:rubocop | ||
stage: rubocop | ||
stage: test | ||
image: cimg/ruby:3.2.0 | ||
script: | ||
- gem install rubocop | ||
- gem install rubocop-rails | ||
- gem install rubocop-performance | ||
- gem install rubocop-rspec | ||
- rubocop | ||
- name: test:rspec | ||
stage: test | ||
image: cimg/ruby:3.2.0 | ||
services: | ||
- image: mysql:5.7.22 | ||
name: mysql-test | ||
environment: | ||
MYSQL_DATABASE: db-test | ||
MYSQL_USER: user-test | ||
MYSQL_PASSWORD: password-test | ||
MYSQL_ROOT_PASSWORD: password-test | ||
script: | ||
- gem install rubocop | ||
- gem install rubocop-rails | ||
- gem install rubocop-performance | ||
- gem install rubocop-rspec | ||
- rubocop | ||
- sudo RAILS_ENV=test bundle exec rails db:drop db:create db:migrate | ||
- bundle exec rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
default: &default | ||
adapter: mysql2 | ||
encoding: utf8mb4 | ||
collation: utf8mb4_unicode_ci | ||
host: mysql-test | ||
ssl_mode: disabled | ||
port: 3306 | ||
pool: 5 | ||
|
||
test: | ||
<<: *default | ||
database: db-test | ||
username: user-test | ||
password: password-test |