forked from stringer-rss/stringer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
109 lines (88 loc) · 2.78 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
version: 2.1
orbs:
browser-tools: circleci/[email protected]
node: circleci/[email protected]
jobs:
build:
parallelism: 1
docker:
- image: cimg/ruby:3.2.2-browsers
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
PGHOST: 127.0.0.1
PGUSER: postgres
RACK_ENV: test
RAILS_ENV: test
- image: cimg/postgres:10.18
environment:
POSTGRES_USER: postgres
POSTGRES_DB: app_test
POSTGRES_PASSWORD:
working_directory: ~/app
steps:
- checkout
- browser-tools/install-browser-tools
# - node/install:
# node-version: 16.13.1
# install-yarn: true
- run:
name: Which bundler?
command: bundle -v
# https://circleci.com/docs/2.0/caching/
- restore_cache:
keys:
- bundle-v1-{{ checksum "Gemfile.lock" }}
- bundle-v1-
- run: # Install Ruby dependencies
name: Bundle Install
command: bundle check || bundle install
# - run:
# name: Bundler Audit
# command: bundle exec bundle audit
- save_cache:
key: bundle-v1-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# - restore_cache:
# keys:
# - yarn-{{ checksum "yarn.lock" }}
# - yarn-
# - run:
# name: Yarn Install
# command: yarn install --cache-folder ~/.cache/yarn
# - save_cache:
# key: yarn-{{ checksum "yarn.lock" }}
# paths:
# - ~/.cache/yarn
- run:
name: Wait for DB
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Database setup
command: bundle exec rake db:create db:schema:load --trace
# - run:
# name: Brakeman
# command: bundle exec brakeman
# - run:
# name: Stylelint
# command: yarn stylelint
- run:
name: Rubocop
command: bundle exec rubocop
- run:
name: Run rspec in parallel
command: |
bundle exec rspec --exclude-pattern "spec/system/*_spec.rb"
# bundle exec rspec --profile 10 \
# --format RspecJunitFormatter \
# --out test_results/rspec.xml \
# --format progress \
# $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
- store_test_results: # https://circleci.com/docs/2.0/collect-test-data/
path: test_results
- run:
name: Run system tests
command: |
COVERAGE=false bundle exec rspec spec/system/