-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathconfig.yml
87 lines (83 loc) · 2.15 KB
/
config.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
75
76
77
78
79
80
81
82
83
84
85
86
87
version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.2.5
node: circleci/node@5.0.2
ruby: circleci/ruby@2.0.0
executors:
rails:
docker:
- image: cimg/ruby:3.1.3-browsers
environment:
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor/bundle
PGHOST: 127.0.0.1
PGUSER: postgres
RAILS_ENV: test
- image: cimg/postgres:14.2
environment:
POSTGRES_USER: postgres
POSTGRES_DB: app_prototype_test
POSTGRES_PASSWORD: "password" # Must be non-empty.
commands:
install-node-deps:
description: Install Yarn and Node dependencies
steps:
- node/install:
install-yarn: true
node-version: "16.18.1"
- node/install-packages:
pkg-manager: yarn
db-setup:
description: Set up database
steps:
# Using structure.sql? Install postgresql-client for loading structure.
#- run: sudo apt-get install postgresql-client
- run:
name: Set up database
command: bundle exec rake db:create db:schema:load
jobs:
load_data:
executor: rails
steps:
- checkout
- ruby/install-deps
- db-setup
- run:
# Ensure seeds run without issues
name: Load seeds
command: bin/rails db:seed
- run:
# Ensure sample_data runs without issues
name: Load sample data
command: bin/rails db:sample_data
rubocop:
executor: rails
steps:
- checkout
- ruby/install-deps
- ruby/rubocop-check
rspec:
executor: rails
# Divide up specs and run them in parallel across multiple containers to mitigate slow tests
# parallelism: 4
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- ruby/install-deps
- install-node-deps
- db-setup
- run:
name: Precompile assets
command: bin/rails assets:precompile
- ruby/rspec-test
- store_artifacts:
# Save screenshots for debugging
path: ./tmp/screenshots
workflows:
version: 2
build:
jobs:
- load_data
- rubocop
- rspec