-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
100 lines (89 loc) · 2.76 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
version: 2.1
jobs:
test:
docker:
- image: circleci/ruby:3.0.2-node
environment:
PGHOST: 127.0.0.1
PGUSER: circleci
RAILS_ENV: test
- image: circleci/redis:3.2-alpine
- image: circleci/postgres:11
environment:
POSTGRES_USER: circleci
POSTGRES_DB: zaikio_oauth_client_test
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v3-dependencies-{{ checksum "Gemfile.lock" }}
# fallback to using the latest cache if no exact match is found
- v3-dependencies-
- run:
name: install dependencies
command: |
gem install bundler:2.1.4 && bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
- ./vendor/bundle
key: v3-dependencies-{{ checksum "Gemfile.lock" }}
- restore_cache:
keys:
- yarn-{{ checksum "test/dummy/yarn.lock" }}
- run: echo "//npm.pkg.github.com/:_authToken=$BUNDLE_RUBYGEMS__PKG__GITHUB__COM" >> ~/.npmrc
- run: echo "@crispymtn:registry=https://npm.pkg.github.com" >> ~/.npmrc
- run: cd test/dummy && yarn install --cache-folder ~/.cache/yarn
- save_cache:
key: yarn-{{ checksum "test/dummy/yarn.lock" }}
paths:
- ~/.cache/yarn
- run: cd test/dummy && bundle exec rake webpacker:compile
- save_cache:
key: webpack-{{ .Revision }}
paths:
- /home/circleci/project/test/dummy/public/packs-test/
- run: sudo apt-get update
- run: sudo apt install postgresql-client
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
- run: bundle exec rake db:create
- run: bundle exec rake db:schema:load
# run tests!
- run:
name: run tests
command: |
bundle exec rake test
publish:
docker:
- image: circleci/ruby:3.0.2
working_directory: ~/repo
steps:
- checkout
- run:
name: Build package
command: gem build zaikio-oauth_client.gemspec
- run:
name: Push package
command: |
VERSION=$(ruby -r "./lib/zaikio/oauth_client/version.rb" -e "print Zaikio::OAuthClient::VERSION")
gem push zaikio-oauth_client-${VERSION}.gem
workflows:
default:
jobs:
- test:
filters:
tags:
only: /.*/
branches:
only: /.*/
- publish:
context:
- rubygems-push
requires: [test]
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/