forked from CircuitVerse/CircuitVerse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
85 lines (71 loc) · 3.01 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
version: 2 # use CircleCI 2.0
jobs: # a collection of steps
build: # runs not using Workflows must have a `build` job as entry point
parallelism: 1 # run three instances of this job in parallel
docker: # run the steps with Docker
- image: circleci/ruby:2.6.5-node-browsers # ...with this image as the primary container; this is where all `steps` will run
environment: # environment variables for primary container
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
PGHOST: 127.0.0.1
PGUSER: postgres
RAILS_ENV: test
- image: circleci/postgres:9.5-alpine # database image
environment: # environment variables for database
POSTGRES_USER: postgres
POSTGRES_DB: circuitverse_test
POSTGRES_PASSWORD: ""
steps: # a collection of executable commands
- checkout # special step to check out source code to working directory
- run:
name: generate private key for token auth
command: openssl genrsa -out config/private.pem 2048
- run:
name: generate public key for token auth
command: openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem
# Install bundler
- run:
name: Install bundler
command: gem install bundler
# Which version of bundler?
- run:
name: Which bundler?
command: bundle -v
# Restore bundle cache
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
- restore_cache:
keys:
- circuiteverse-{{ checksum "Gemfile.lock" }}
- circuiteverse-
- run: # Install Ruby dependencies
name: Bundle Install
command: bundle install --with postgresql
- run: # Install JS dependencies
name: Yarn Install
command: yarn
# Store bundle cache for Ruby dependencies
- save_cache:
key: circuiteverse-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Wait for DB
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Copy sample database configuration
command: cp config/database.example.yml config/database.yml
- run:
name: Database setup
command: bin/rails db:schema:load
- run:
name: Run rspec in parallel
command: |
COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN 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)
# Save test results for timing analysis
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: test_results